About JSON to XML
Turning JSON into XML means deciding what attributes, elements and text should be, because JSON has no equivalent distinction. This converter uses the inverse of the mapping its sibling XML to JSON tool uses: object keys starting with @ become attributes, a #text key becomes text content, arrays become repeated elements and plain object keys become child elements.
A root element always wraps the document, because XML requires exactly one root. Its name is configurable and defaults to root; if the JSON has a single top-level key with the same name, that key is treated as the root element instead, which makes the XML to JSON output round-trip cleanly. Element names are sanitised to valid XML names, special characters are escaped and the result is checked by parsing it back with DOMParser before you copy it.
What this tool does
Inverse mapping
@ keys become attributes, #text becomes text content, arrays become repeated elements and other object keys become child elements.
Configurable root element
Set the root name for any document; a single top-level key that matches the root name is unwrapped so XML to JSON output round-trips.
Array to repeated elements
Every array item is emitted as an element with the same name, which is how XML represents lists, including nested arrays.
Escaping handled
Ampersands, angle brackets and quotes are escaped in text and attribute values, so the result stays well formed without manual editing.
Valid XML output
The generated XML is parsed with DOMParser before it is shown, so malformed names or structure are caught instead of downloaded silently.
Copy, download, no upload
Copy the XML or download it as an .xml file; the JSON is read locally in the browser and never sent to a server.
How to use JSON to XML
- 01
Paste or load JSON
Paste the JSON into the input pane or load a .json file from your device; files up to 10 MB are accepted.
- 02
Choose the root name
Set the root element name, root by default. If the JSON has a single top-level key with that name, it becomes the root element itself.
- 03
Convert to XML
Press Convert. The JSON is parsed, mapped to elements, attributes and text, escaped and then validated as XML.
- 04
Review the XML
Check the output for expected attributes, repeated elements and escaped characters, and fix any JSON error shown with a line and column.
- 05
Copy or download
Copy the XML to the clipboard or download it as an .xml file named after the uploaded document.
Supported formats and limits
- Input
- JSON
- Output
- XML
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Maximum size
- Bound by the memory available to your browser tab.
- Requirements
- Chrome, Edge, Firefox or Safari · JavaScript enabled
Limitations worth knowing
- JSON has no native attributes or text, so attributes and #text only appear when the JSON uses the documented @ and #text conventions.
- Object keys that are not valid XML names are sanitised, so the output name can differ slightly from the JSON key.
- A single-element array becomes one element and, when read back with the default array mode of XML to JSON, comes back as a scalar.
- Input is capped at 10 MB of JSON and conversion runs on the main thread after a short yield.
Privacy and file handling
Your JSON is read, parsed and converted entirely inside this browser tab. The payload is never uploaded to FormatFlow or anyone else, no copy is stored and nothing leaves your device; closing the page clears the input and the XML result.
Read the full privacy policy
