JSON to XML Converter
Example
Input:
{"person": {"name": "Ali", "age": 30}}Output:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<person>
<name>Ali</name>
<age>30</age>
</person>
</root>About this converter
JSON and XML model data differently — JSON has arrays and types, XML has attributes and text — so every converter makes conventions, and this one documents its own: object keys become element names; an array under a key repeats that element; a key starting with @ becomes an attribute of its element; #text sets text content alongside children. Values are XML-escaped. The mapping round-trips with this site's XML to JSON converter, which uses the mirror-image conventions. Element names must be valid XML names (letters, digits, - _ . after the first character) — JSON keys with spaces or slashes need renaming first, which is a real constraint of XML itself, not of this tool.
Frequently Asked Questions
How are arrays converted?
As repeated elements with the same tag: {"b": [1, 2]} becomes <b>1</b><b>2</b>.
Can I control attributes?
Yes — prefix a key with @ inside an object and it becomes an attribute of that element instead of a child element.