What does the JSON to XML converter do?
It turns a JSON document into XML as you type. Each JSON key becomes an XML element, nested objects become nested elements, and the result is wrapped in a <root> element because an XML document needs one top-level element. Arrays become repeated elements with the same name.
Click Swap direction to convert XML to JSON instead: the current XML moves into the input. XML attributes appear in the JSON output as keys that start with @_, and those keys become attributes again when you convert back.
How do you convert JSON to XML?
- Paste your JSON into the input editor.
- Check the XML output on the right. If the JSON is invalid, the error is shown instead.
- Click Copy result, or Download to save the file as output.xml.
Frequently asked questions
Why is the output wrapped in a root element?
An XML document must have a single top-level element, while JSON can have several keys at the top level. Wrapping everything in <root> keeps the output well-formed.
How are JSON arrays converted to XML?
Each item becomes its own element named after the array key. For example, "tags": ["a", "b"] becomes <tags>a</tags><tags>b</tags>.
How are XML attributes shown in JSON?
Attributes become keys prefixed with @_. For example, <item id="5"> becomes an object with an "@_id" key. Converting that JSON back to XML turns @_ keys into attributes again.
Is my data uploaded?
No. The conversion runs entirely in your browser and your data stays on your device.