About JSON ⇄ XML
Paste JSON to get well-formed XML, or paste XML to get JSON. Choose the root element name, the name used for array items, the indentation and whether to add an XML declaration.
A simple convention keeps attributes round-tripping: JSON keys that start with @ become XML attributes and #text holds an element’s text. Repeated XML elements become arrays, and numbers stay as text unless you ask for conversion, so values such as 007 are not changed.
Invalid JSON and invalid XML are reported with a clear message, including the line and column for XML. Unicode text such as Nepali is kept as it is, and the conversion runs entirely in your browser.
How to use it
- Pick JSON → XML or XML → JSON.
- Paste your data and set the options you need.
- Copy the result or download it, or use it as the input for the reverse conversion.
Frequently asked questions
- How are XML attributes represented in JSON?
- As keys that start with @, for example {"@id":"1"}. Going back, those keys become attributes again. An element’s text sits under #text when it also has attributes or children.
- Why does XML to JSON keep numbers as strings?
- XML has no number type, and converting could damage values like 007 or very long IDs. Turn on “Convert numbers and true/false” if you want typed values.
- What happens to JSON arrays and null?
- An array repeats its tag, once per item. A top-level array is wrapped in a root element with item tags. null becomes an empty element.
- Is my data uploaded?
- No. Both directions run in your browser.