JSON to XML Converter
JSON to XML Converter
Convert any JSON object or array to well-formed XML in one click. Special characters are escaped, arrays become repeated elements, and null values use the standard xsi:nil attribute. Set your own root element name and download the result as an .xml file. Runs entirely in your browser.
Where Is This Useful?
How to Use
- Paste a JSON object or array in the input panel
- Set the root element name (defaults to root)
- Click Convert to XML or press Ctrl+Enter
- Copy the XML output or download as an
.xmlfile
Conversion Rules
- Output starts with
<?xml version="1.0" encoding="UTF-8"?> - JSON objects become nested XML elements
- JSON arrays become repeated elements with the same tag name
- Strings with
&,<,>are escaped automatically - Null values rendered as
<tag xsi:nil="true"/> - Invalid tag names (digits, spaces) are sanitized with underscores
Frequently Asked Questions
Does it add an XML declaration?
Yes. Every output starts with <?xml version="1.0" encoding="UTF-8"?> so the result is a complete, valid XML document.
How are JSON arrays converted?
Each item in a JSON array becomes a repeated element with the same tag name as the array key. For example, "items": [1, 2] becomes two <items> elements.
Are special characters escaped?
Yes. Characters like &, <, >, ", and ' are escaped to their XML entity equivalents.
Can I also convert XML back to JSON?
Yes. Use the XML to JSON Converter to go the other direction.
Is my JSON uploaded anywhere?
No. Everything runs locally in your browser. Your data never leaves your machine.
Related Tools