JSON to XML Converter

Paste JSON and click Convert to XML. You get indented, well-formed XML with an XML declaration, ready to use or to validate.

Editor (Formatted View)
1
Ready — paste or type JSON here
Viewer
Tree view will appear here after formatting
Ready

How to convert JSON to XML

  1. Paste JSON into the editor, or load a file.
  2. Click Convert to XML. If the JSON has a syntax error, click Format to see exactly where, and Repair to fix common mistakes.
  3. Copy or download the XML from the result panel.

How JSON maps to XML

JSONXML
The whole documentWrapped in a <root> element
Object key "name": "Ada"Element <name>Ada</name>
Nested objectChild elements
Array "tag": ["a", "b"]Repeated elements <tag>a</tag><tag>b</tag>
A top-level arrayOne <item> element per entry inside <root>
Numbers and booleansElement text, e.g. <active>true</active>

For example, {"user": {"name": "Ada", "roles": ["admin", "dev"]}} becomes:

<root>
  <user>
    <name>Ada</name>
    <roles>admin</roles>
    <roles>dev</roles>
  </user>
</root>

Things to check

Conversion runs on our server in memory; the data isn't stored.

Frequently asked questions

How are JSON arrays converted to XML?

Each array item becomes an element with the same name as the array key, repeated once per item. A top-level array becomes <item> elements inside <root>.

What is the root element called?

The converted XML is wrapped in a <root> element, because XML needs exactly one top-level element and JSON doesn't name its outer object. Rename it in the result if your system expects another name.

Why does conversion fail for some keys?

XML element names can't contain spaces, start with a digit or contain most punctuation. Rename such keys in the JSON first.

Can I convert XML back to JSON?

Yes, use the XML to JSON converter. Note that a round trip may not give identical JSON, because XML doesn't record types or whether a single element was an array.

Is my data stored?

No. The conversion runs on our server in memory and the result is sent straight back; nothing is saved.

Other tools

Share Content

Choose what to share and generate an instant link

🔥 One-time link Content deleted from server after first view
✉️
Uploading to server…