JSON to XML
Convert JSON to well-formed XML as you type, with a root element, indentation and valid element names.
Your files stay on your device. Nothing is uploaded.
Step 1: Paste or open your JSON
Step 2: Options
Step 3: Copy or download
How to convert JSON to XML
-
Paste or open your JSON
Paste JSON into the first box, or click Open a file. The conversion runs as you type.
-
Choose the options
Choose the indent, and the name of the root element used when the JSON needs one.
-
Copy or download
Click Copy XML, or Download .xml for a file.
About this tool
How JSON maps to XML
Each key becomes an element and each list repeats its element. Keys that start with @ become attributes, and "#text" becomes the element's text, the same rules XML to JSON uses, so data can go both ways.
One root element
XML needs exactly one root element. If your JSON is an object with one key, that key is the root. A list, or an object with several keys, is wrapped in the root name you choose (root by default), and list entries become <item> elements.
Names XML accepts
XML element names cannot contain spaces or start with a digit. Keys like "first name" become first_name and "2nd" becomes _2nd, so the result always opens in XML tools. Letters of any language, such as Urdu, are allowed.
Privacy
This tool runs in your browser, on your own device. Your files and text are not uploaded to our server and we cannot see them. When you close or reload this tab, they are cleared, along with the results.
Frequently asked questions
My JSON shows an error
The message gives the line and column of the first problem, such as a missing comma or a trailing comma, which JSON does not allow.
Are numbers kept exactly?
Numbers keep their value (1.50 is written as 1.5), and numbers with more than 15 digits, such as long IDs, keep every digit.
Is my data sent anywhere?
No. The conversion runs in your browser.
Is there a size limit?
Files up to 20 MB.
Related tools
- XML › JSON XML to JSON Convert XML to JSON as you type, attributes included.
- JSON › YAML JSON to YAML Convert JSON to clean, readable YAML as you type.
- YAML › JSON YAML to JSON Convert YAML to JSON as you type, with clear errors.
- JSON › XLSX JSON to Excel Turn a JSON list of objects into an Excel sheet.
- JSON › CSV JSON to CSV Turn a JSON list of objects into a CSV table.
- XLSX › JSON Excel to JSON Turn an Excel sheet into a JSON list of objects.
- CSV › JSON CSV to JSON Turn a CSV table into a JSON array of objects.
- Aa › AA Case converter Change text to upper, lower, title or sentence case.