JSON to XML Converter
Turn JSON into well-formed XML. Your data stays on your device.
- Runs in your browser
- No sign-up
- No watermark
Objects become elements, arrays become repeated elements with the same name, and values become text. A key that starts with @ is written as an attribute, and a key called #text becomes the text of the element. If your JSON has a single top-level key, it is used as the root element. Otherwise the tool wraps everything in a root element you name.
Names that are not allowed in XML are fixed and you are told how many. The XML is built in your browser and is not uploaded.
How to use JSON to XML
- Paste your JSON, or choose or drop a .json file.
- Set the root element name and the layout.
- Tick or clear the XML declaration.
- Copy the XML or download it.
Frequently asked questions
Is my JSON uploaded?
No. The XML is created in your browser.
How do I write attributes?
Start the key with @. For example {"book": {"@id": "1", "title": "Dune"}} becomes <book id="1"><title>Dune</title></book>. Use #text for text that sits next to attributes.
How are arrays written?
Each item becomes its own element with the key name. {"tag": ["a", "b"]} gives <tag>a</tag><tag>b</tag>. A top-level list is wrapped in the root element with each item called item.
What if a key is not a valid XML name?
Spaces and symbols become underscores, and a name that starts with a digit gets an underscore in front. The status line says how many names were changed.
What happens to null?
null becomes an empty element, such as <note/>.
Can I get it all on one line?
Yes. Choose One line in the layout list for XML without extra spacing.