JSON to XML
Convert a JSON file into an XML document.
Add a file
JSON, XML, text or any file you want to encode, decode or hash.
Choose an output
Convert a JSON file into an XML document.
About JSON to XML
This converter turns a JSON document into XML with an XML declaration and a single <root> element. Each object key becomes a child element, and arrays are written as repeated elements that share the key's name, which is the common convention for representing JSON lists in XML.
When it helps
- Feeding JSON data into a legacy SOAP service, XSLT pipeline or enterprise system that only accepts XML.
- Creating sample XML from an existing JSON fixture for testing a parser.
- Converting a JSON config into XML for tools such as Maven-style or .NET configuration that expect element trees.
Tips
- Characters that are not allowed in XML element names, such as spaces or slashes in keys, are replaced with underscores.
- All values become element text. JSON types (number, boolean, null) are not preserved as attributes or schema types, and null becomes an empty element.
- XML element names cannot start with a digit, so keys like "2024" produce elements that strict parsers may reject. Rename such keys first.
- Ampersands, angle brackets and quotes in values are escaped as entities.
Good to know
Quick answers about json to xml in your browser.
An array under the key "items" becomes several sibling <items> elements, one per entry. There is no wrapper element, so a single-item array and a plain value look the same in the XML.
No. This tool always writes child elements. If you need a round trip with attributes, the XML to JSON tool maps attributes to keys prefixed with @.
Yes. There is no sign-up, no watermark and no limit on how many files you process.
No. Files are read and processed locally in your browser, so they never leave your device.
Related tools
Part of the Developer Tools collection.