All Tools › Data & Lists

JSON to XML Converter

Convert JSON to well-formed XML, or parse XML back into JSON — instantly in your browser.

Your converted result will appear here.

How it works

The JSON → XML path parses your input with JSON.parse, then walks the object recursively. Each key becomes an XML element, arrays repeat the element tag (or use <item>), and primitives become text content. Special characters (&, <, >, ") are escaped so the result is well-formed. The XML → JSON path uses DOMParser to build a DOM tree, then reduces it: text-only nodes become string values (auto-coerced to numbers, booleans, or null when possible), and repeated sibling tags collapse into arrays. A single wrapper root element keeps the output valid JSON.

Related tools

Frequently asked questions

Is my JSON or XML data sent to a server?

No. All parsing and conversion happens locally in your browser using JavaScript. Nothing is uploaded, which makes it safe for sensitive or private payloads.

Can I convert XML back into JSON?

Yes. Switch to the XML → JSON tab, paste your XML, and click Convert. The tool parses the DOM and produces a compact JSON representation, collapsing repeated tags into arrays automatically.

How are arrays represented in the XML output?

By default, each array entry becomes a repeated element with the parent key as its tag. You can customise the root tag in the options, and primitives, objects, and nested arrays are all handled recursively.