JSON to XML Converter
Convert JSON to XML with a configurable root element — nested objects become elements, arrays repeat, and output is neatly indented.
About the JSON to XML Converter
This converter turns JSON into well-formed, indented XML. Object keys become element names, nested objects become nested elements, arrays repeat an element for each item, and scalar values become text content. You choose the root element name that wraps the whole document.
It's handy for feeding JSON data into systems that expect XML — SOAP services, legacy enterprise integrations, RSS-style feeds and XML configuration formats — without writing conversion code by hand.
Everything runs locally in your browser, so your data is never uploaded, and the output is ready to copy or download as an .xml file.
How to Use the JSON to XML Converter
- 1Paste your JSON into the input box.
- 2Set the root element name.
- 3Click Convert to generate indented XML.
- 4Copy the XML or download it as a file.
Frequently Asked Questions
How are JSON arrays represented in XML?
XML has no array type, so each array item is emitted as a repeated element sharing the same tag name (taken from the property). For example {"items":[1,2]} becomes <items>1</items><items>2</items>. Consumers read repeated elements as a list.
How are keys that aren't valid XML names handled?
XML element names can't start with a digit or contain spaces and certain symbols. The converter sanitises such keys into valid element names so the output stays well-formed. Keep keys simple and identifier-like for the cleanest result.
Does it add an XML declaration?
Yes, the output begins with a standard <?xml version="1.0" encoding="UTF-8"?> declaration, and the whole document is wrapped in the root element you specify so it has a single top-level node as XML requires.
Can I convert the XML back to JSON?
Yes — use the XML to JSON Converter tool for the reverse direction. Note that JSON-to-XML-to-JSON round trips aren't always identical, because XML can't distinguish, say, a single-item array from a lone object without extra conventions.
Is my JSON uploaded?
No. Conversion runs entirely in your browser, so nothing is sent to a server. It's safe for data containing sensitive values.