XML to JSON Converter
Converts XML into readable JSON, with attributes and repeated elements handled.
Convert JSON into well-formed XML for systems that only accept XML. Keys become elements, arrays become repeated elements, and special characters are escaped for you.
.json file.converted.xml."tag": ["a", "b"] → <tag>a</tag><tag>b</tag>.@ become attributes, and a #text key becomes the element's text.null and empty strings become empty elements such as <note/>. Numbers and booleans are written as text.item._, and a name that starts with a digit gets a _ in front. Each change is listed as a warning.Input:
{"order": {"@id": "1001", "customer": "Ada & Co", "items": [{"sku": "A1", "qty": 2}, {"sku": "B7", "qty": 1}], "paid": true}}Output:
<?xml version="1.0" encoding="UTF-8"?>
<order id="1001">
<customer>Ada & Co</customer>
<items>
<sku>A1</sku>
<qty>2</qty>
</items>
<items>
<sku>B7</sku>
<qty>1</qty>
</items>
<paid>true</paid>
</order>
item.2 and "2" both become the text 2.Start the key with @. {"book": {"@id": "b1"}} becomes <book id="b1"/>.
An XML document must have exactly one root element. When the JSON has several top-level keys, or is an array, the converter adds the root you named.
Yes, <?xml version="1.0" encoding="UTF-8"?> is added at the top. Untick Add XML declaration to leave it out.
No. The conversion runs in your browser.
Often used together with the JSON to XML Converter.
Converts XML into readable JSON, with attributes and repeated elements handled.
Converts YAML documents into well-formed, indented XML.
Turns an array of JSON objects into a CSV table.