Objects become nested elements, arrays become repeated elements with the parent key’s name, keys starting with @ become attributes and #text becomes element text. Invalid XML names are made safe automatically.
How to convert JSON to XML
- Paste JSON or open a .json file.
- Set the root element name and indentation.
- Press Convert to XML, then copy or download.
Element names
XML names cannot start with a digit or contain spaces, so keys like 2024 sales become _2024_sales. Special characters in values are escaped (&, <, >).
Frequently asked questions
Does it add an XML declaration?
Yes, an <?xml version="1.0" encoding="UTF-8"?> declaration is added at the top.
Updated October 2026 · Built and tested by Sharjeel Tahir · How our tools are tested