Convert JSON to XML
Turn JSON data into well-formed, readable XML.
Report a problem with this tool
How to use JSON to XML
Paste your JSON
Paste JSON, or open or drop a .json file. It’s checked and converted as you type.
Set the options
Name the root element, choose the indent or one line, and add the XML declaration if you need it.
Copy or download
Copy the XML, or download it as a .xml file.
Why use Utils365
Attributes and text
Keys starting with @_ become attributes and #text becomes an element’s text, the same convention our XML to JSON converter uses, so data can go back and forth.
Always well-formed
Special characters like & and < are escaped, and keys that aren’t valid XML names are made safe, so the result opens in any XML tool.
Lists as repeated elements
{"book": [ … ]} becomes one <book> element per item, the way XML usually holds lists.
Private by design
Your JSON is converted on your device and never uploaded.
Frequently asked questions
How is the root element chosen?
If your JSON is an object with a single key, like {"catalog": { … }}, that key becomes the root. Anything else is wrapped in the root element you name, root by default.
What happens to keys that aren’t valid XML names?
Characters XML names can’t hold, like spaces, become _, and a name that starts with a digit, hyphen or dot gets _ in front. So "first name" becomes first_name and "2024" becomes _2024.
How do I make an attribute?
Start the key with @_, like "@_id": 1, which becomes id="1" on the element. Use "#text" for the element’s own text next to attributes.
How are arrays converted?
Each item becomes an element with the array’s key as its name. A list inside a list, or a list at the top level, uses <item> elements.
What about null and empty values?
null, an empty string and an empty object become an empty element like <name/>. An empty list adds no elements.