JSON to XML Converter
Paste JSON and turn nested objects and arrays into clean, readable XML.
This tool runs entirely in your browser. Your JSON is never uploaded anywhere.
How to use this tool
This JSON to XML converter tool changes your nested data structure from JSON into XML without leaving the page. Paste or type your JSON into the input box. If you want, set a root element name, choose what each array item should be called, and pick how many spaces to indent with. Click Convert to XML and the XML appears in the output box, ready to copy or download. If your JSON has a mistake, the tool shows the parse error so you can fix it.
How it works
The converter parses your text with the browser's built-in JSON.parse, then walks the resulting value recursively. Each object key becomes an XML element, and each value becomes that element's content. Arrays do not have keys of their own, so every entry is written out as a repeated element using the array item name you chose. Special characters such as &, < and > are escaped so the XML stays valid. Everything happens client-side, so this works as a fast json to xml online conversion with no account needed.
A real example
Suppose you start with this JSON:
With a root name of root and an array item name of item, the tool produces:
The object text array convert step is handled in one pass: the title string becomes an element, and the tags array becomes a tags element holding two repeated item elements.
Common questions
Is my JSON sent to a server?
No. The conversion runs entirely in your browser using native JavaScript. Nothing you paste is uploaded, stored, or logged anywhere.
How are arrays converted to XML?
XML has no array type, so each array entry is written as a repeated element. You control the tag name with the "Array item name" field, which defaults to "item".
What happens if my JSON is invalid?
The tool stops and shows the exact parse error message from the browser, including roughly where the problem is, so you can correct your JSON and try again.
Why are some keys changed in the output?
XML element names cannot contain spaces or certain characters and cannot start with a number. The tool cleans such keys so the result is valid XML, replacing unsupported characters with an underscore.
Can it handle deeply nested data?
Yes. The converter walks any nested data structure recursively, so objects inside arrays inside objects all convert correctly, limited only by your browser's memory.