XML to JSON Converter
Paste XML and get clean JSON: attributes become @keys, repeated elements become arrays, and numbers and booleans keep their type.
This tool runs entirely in your browser.
How to use the XML to JSON Converter
- 1Paste your JSON (or XML when converting XML → JSON).
- 2Optionally set the root element and the name used for array items.
- 3Copy or download the converted output.
What is the JSON to XML Converter?
JSON and XML model data differently, so a few conventions are used: each object key becomes a child element, an array becomes the same element repeated (“tags”: [“a”, “b”] → <tags>a</tags><tags>b</tags>), null becomes an empty element, and keys prefixed with @ become attributes. Keys that aren’t valid XML names — like “2nd key” — are adjusted to _2nd_key.
XML → JSON does the reverse: attributes get an @ prefix, repeated elements become arrays, text next to child elements is stored as #text, and numbers and true/false are converted to JSON types. Inline DTDs are rejected to avoid entity-expansion attacks.
Frequently asked questions
Why is there no root element in my JSON?
If the JSON object has a single top-level key, that key becomes the root. Otherwise everything is wrapped in <root> — or the name you enter.
Does XML → JSON keep the order of mixed elements?
Elements with the same name are grouped into one array, so the original interleaving of different elements is not preserved.
Is the JSON to XML Converter free and private?
Yes. The JSON to XML Converter is free, needs no account, and runs entirely in your browser. What you type is never sent to a server or stored.
