What does this tool do?
JSON to XML converts the JSON you paste into a neatly indented, readable XML document. You choose the root tag name, arrays expand into repeated elements, and special characters are safely escaped. It is handy for anyone moving data into legacy systems, SOAP services, or configuration files that expect XML.
How to use it
- Paste or type your data into the left field.
- The result is generated instantly on the right.
- Use the Copy button to grab the output.
Arrays and special characters
A JSON array is turned into XML by repeating the same tag for each value; every item in a hobbies array, for example, becomes its own <hobbies> element. This is the natural XML equivalent of a list. Characters in text content such as &, < and > are automatically escaped to &, < and > so the output stays valid. A null value is written as a self-closing empty element like <tag/>.
Root tag and tag naming
The Root tag field at the top sets the name of the outermost wrapper and defaults to root. JSON keys are turned directly into tag names, and any character that is not a letter, digit, or underscore is replaced with an underscore to keep names safe. A standard XML declaration (<?xml version="1.0" encoding="UTF-8"?>) is added to the top of the output. The whole conversion runs in your browser and no data is sent to a server.
Frequently asked questions
How are JSON arrays represented in XML?
Each array element is repeated as a separate element sharing the key's name. Since XML has no built-in array type, this is the standard approach.
Do JSON keys become XML attributes or elements?
All keys become nested elements; the tool does not produce attributes. This is the most predictable mapping for most JSON structures.
What happens to keys with characters that are invalid in tags?
Any character other than a letter, digit, or underscore is replaced with an underscore, so you always get valid XML element names.
Is JSON to XML free?
Yes. JSON to XML and all 300+ tools on MagmaNex are completely free with no signup or account required.
Is my data safe?
Yes. Everything runs locally in your browser. The data you enter is never sent to a server, stored, or shared.
Does it work on mobile?
Yes. JSON to XML works on phones, tablets and desktops — no app download needed.
🔒 Privacy: everything runs in your browser, your data is never sent to a server.
