JSON to XML converter
Turn JSON into well-formed XML. Objects become nested elements, arrays become repeated elements, and keys that start with @ become attributes.
Loading the tool…How to use it
- Paste JSON or drop a .json file.
- Set the root and array-item element names and the attribute prefix.
- Copy or download the .xml.
Private by design
The conversion runs as JavaScript in this tab. Your data is not uploaded, logged or stored. There is no account and no file-size paywall.
How JSON maps to XML
A JSON object with a single key becomes the root element. Otherwise everything is wrapped in a root element you name. Each array item is written as a repeated element named after its parent key (or the item name you choose for top-level arrays). Keys that are not valid XML names, such as “unit price” or “2024”, are made safe (unit_price, item_2024), and &, < and quotes in values are escaped.
Questions
Is my file uploaded anywhere?
No. The file is read by JavaScript in this tab and never leaves your device. You can load the page, switch off Wi-Fi and it keeps working.
How do I create attributes?
Prefix the key with @ (or _ if you choose that option): {"@id": 7} on an object becomes id="7".
Is the output valid XML?
Yes, it is well-formed UTF-8 XML. It is not validated against an XSD schema.