Free Tool

JSON to XML Converter

Convert JSON to well-formed XML instantly. Full control over root elements, array wrapping, and attribute mapping — free, no server uploads.

Loading editor…

How to Use the JSON to XML Converter

  1. 1

    Paste your JSON into the left editor panel above.

  2. 2

    Set the root XML element name in the settings panel (default: "root").

  3. 3

    Choose how arrays should be represented — repeated elements or wrapped in a parent node.

  4. 4

    Enable "Keys as attributes" and use the @ prefix for any keys you want as XML attributes.

  5. 5

    Click "Convert" and copy or download the formatted XML output.

Key Features

Well-Formed XML Output

Every conversion produces valid, well-formed XML with a proper prolog and correctly escaped special characters.

Attribute Mapping

Prefix any JSON key with "@" to output it as an XML attribute instead of a child element — perfect for SOAP APIs.

Array Wrapping Control

Choose whether arrays produce repeated same-name elements or are wrapped in a parent container element.

Character Escaping

All XML special characters (<, >, &, ", ') are automatically escaped in text content and attribute values.

Why JSON Flash?

  • Configurable root element name — matches any target XML schema.
  • Attribute mapping with @ prefix for SOAP-compatible output.
  • Produces valid UTF-8 XML with prolog declaration.
  • Runs entirely in your browser — no data sent to any server.
  • Free with no size limits for typical API payloads.

Frequently Asked Questions

How do I convert JSON to XML?

Paste your JSON into the editor above, set the root element name (default: "root"), and click Convert. JSON Flash maps each JSON key to an XML element and each value to its text content.

How are JSON arrays converted to XML?

JSON arrays become repeated XML elements with the same tag name. For example, the array "items": ["a","b"] becomes <items>a</items><items>b</items>. You can optionally wrap them in a parent <items> element.

Can I control the XML root element name?

Yes. Type any valid XML element name into the "Root element" field before converting. The default is "root" but you can use any name your target system expects.

How are JSON keys with special characters handled?

JSON keys that are not valid XML element names (e.g., keys starting with numbers or containing spaces) are sanitised by replacing invalid characters with underscores.

Can JSON values become XML attributes instead of elements?

Yes. Enable "Keys as attributes" mode and prefix any JSON key with "@" (e.g., "@id") to output it as an XML attribute on the parent element rather than a child element.

Does the converter produce valid XML?

Yes. All output is well-formed XML with a proper <?xml version="1.0" encoding="UTF-8"?> declaration. The converter escapes special characters (<, >, &, ", ') to produce valid XML text content.

What encoding does the XML output use?

The output XML always uses UTF-8 encoding, declared in the XML prolog. All Unicode characters in your JSON values are preserved as-is in the UTF-8 output.

Can I convert XML back to JSON?

Yes. Use the XML to JSON tool (linked below) to convert XML back to a JSON object, with automatic type detection for numbers and booleans.

Unlock Pro — unlimited AI, 10 MB files, API access

Starting at $4/mo · 14-day money-back guarantee

  • Convert large XML files up to 50 MB
  • XSD schema validation of the XML output
  • Custom namespace prefix support
  • Batch JSON to XML conversion
  • API endpoint for automated conversion pipelines
Upgrade →