About the JSON to XML Converter
Many older systems, SOAP services, RSS feeds, Android resources and enterprise integrations still expect XML, while modern APIs speak JSON. This converter maps one to the other: each JSON key becomes an XML element, nested objects become nested elements, and arrays become repeated elements with the same name.
You control the root element name, the name used for array items and the indentation. Keys that start with @ can become attributes, a #text key becomes the element's text, and text that contains special characters can be wrapped in CDATA. Invalid key names are cleaned up automatically so the output is always well-formed XML.
How to use the JSON to XML Converter
- Paste your JSON or open a .json file.
- Set the root element and array item names if you need specific ones.
- Choose indentation and whether to add an XML declaration, attributes or CDATA.
- Copy the XML or download it as a .xml file.
Key features
- Nested objects and arrays converted correctly
- Custom root and array item element names
- @ keys become attributes, #text becomes element text
- Optional CDATA for text with special characters
- Clear error messages for invalid JSON
Tips for the best results
- Set a meaningful root element name, as XML requires exactly one root.
- Use @ keys in your JSON to create XML attributes.
Frequently asked questions
How are JSON arrays converted?
Each item in an array becomes a repeated element using the array's key as its name. For example "books": [ ... ] becomes several book-level elements named books, one per item.
Why do some element names change?
XML element names cannot start with a number or contain spaces and most symbols. Those characters are replaced with underscores so the XML stays valid.
How do I create XML attributes?
Start the key with @, for example "@id": "5". With the attributes option on, it becomes id="5" on the parent element.
What happens to null values?
A null becomes an empty, self-closing element such as open/ so the field is still present in the XML.
Is my JSON uploaded?
No. Conversion runs in your browser.