JSON to XML
Convert JSON to well-formed XML with a configurable root element and attribute support.
About the JSON to XML
The JSON to XML converter produces well-formed XML from JSON, with a root element you choose. Arrays become repeated elements, which is how most XML formats represent lists.
Conversion happens in your browser, so your files and records stay private.
How to use the JSON to XML
- Paste JSON.
- Set the root element name and indentation.
- Copy or download the XML.
Frequently asked questions
How are invalid element names handled?
JSON keys that are not valid XML names (for example ones starting with a digit) are adjusted so the output stays well-formed.
Can I create XML attributes?
Yes. Keys that start with @_ become attributes, so { "book": { "@_id": "1" } } produces <book id="1">.
Related tools
JSON to CSV
Convert JSON arrays to CSV with automatic column detection, nested object flattening and custom delimiters.
CSV to JSON
Convert CSV to a JSON array with header detection, type inference and delimiter auto-detection.
XML to JSON
Convert XML to JSON, preserving attributes and repeated elements as arrays.
JSON to YAML
Convert JSON to clean, human-readable YAML.
YAML to JSON
Convert YAML documents to formatted JSON with syntax validation.
JSON to PHP Array
Convert JSON to a PHP array literal using short or long array syntax.