Convert JSON to XML
Convert a JSON object to a well-formed XML document, with readable indentation.
Processed on your device. Nothing is sent to any server.
Walks the JSON object and generates the corresponding XML tags, using @_-prefixed keys as attributes when present.
Use cases
- Generating an XML document from JSON configuration data.
- Preparing data for a system that only accepts XML.
- Migrating data from JSON to an XML format.
How it works
- 1
Paste your JSON
Type a JSON object with a single root element.
- 2
Convert it
Click Convert and copy or download the resulting XML.
Technical details
- Keys starting with @_ become attributes: {"user": {"@_id": "7", "name": "Ana"}} → <user id="7"><name>Ana</name></user>.
- If the JSON is an array, a bare value or an object with several top-level keys, it's automatically wrapped in a <root> element (and array items in <item>), because XML needs a single root element.
- Keys are used as-is for tag names: a key with spaces or starting with a digit isn't a valid XML name.
Frequently asked questions
Does the JSON need a single root element?
No: if it doesn't have one, the tool wraps it in <root>. If you want a different root name, make it the only top-level key yourself, for example {"catalog": {…}}.