Free · runs in your browser · no upload · no quota
JSON to XML Converter
Convert JSON into well-formed XML. Objects become elements, arrays become repeated elements, and keys that start with @ become attributes — the same convention the XML to JSON tool uses, so the two round-trip.
How to Convert JSON to XML
- Add your JSON
Paste it into the left box or open a .json file. - Name the elements
Set the root element (rootby default) and the element used for the items of a top-level array. Keys starting with@become attributes. - Copy or download the XML
Copy the result, or click Download to save an .xml file.
Example
{
"book": {
"@id": "42",
"title": "Dune",
"tags": ["sf", "classic"]
}
}<?xml version="1.0" encoding="UTF-8"?>
<root>
<book id="42">
<title>Dune</title>
<tags>sf</tags>
<tags>classic</tags>
</book>
</root>Frequently Asked Questions
-
How are attributes written?A key starting with
@becomes an attribute of its element:{"@id": "42"}givesid="42". A#textkey becomes the element's text. -
What about keys that are not valid XML names?Characters XML does not allow in a name (spaces, a leading digit…) are replaced with an underscore, so the output is always well-formed.
-
Are special characters escaped?Yes. &, <, > and quotes are escaped in text and attributes.
-
Is anything uploaded?No. The conversion runs in your browser.
More browser tools
Working with files rather than text? Our file converters handle CSV to XML and 400+ other formats.