JSON to XML Converter
JSON to XML Converter turns a JSON document into well-formed, indented XML. Object keys become elements, arrays repeat their element, and keys prefixed with @ become attributes — a convention that round-trips with the XML to JSON tool.
Pick the root element name and paste your JSON; the XML updates instantly. Everything runs in your browser.
How to use JSON to XML Converter
- 1
Set the root element
Name the wrapping XML element (defaults to 'root').
- 2
Paste your JSON
Drop in the JSON to convert — the XML appears live.
- 3
Copy the XML
Grab the formatted XML with the copy button.
How JSON maps to XML
Each object key becomes a child element, and a nested object becomes nested elements. An array produces one repeated element per item. To represent XML attributes, prefix a key with @; to set an element's text alongside attributes, use the #text key. This mirrors the structure the XML to JSON tool produces, so the two convert back and forth.
Values are escaped automatically, so characters like < and & in your data produce valid XML.
When to convert JSON to XML
XML is still the expected format for many enterprise systems, SOAP APIs, RSS/Atom feeds and document formats. Converting JSON to XML lets data from a modern JSON source feed into those systems without hand-writing the markup.
If you need to go the other way, the XML to JSON converter reverses the transformation.
Frequently asked questions
- How are attributes represented?
- A JSON key prefixed with @ becomes an XML attribute, and the #text key becomes the element's text content.
- Can I choose the root element name?
- Yes. The root element field lets you name the wrapping element.
- Is my data sent to a server?
- No. The conversion runs entirely in your browser.
Last updated: