JSON → XML Converter

Turn JSON into well-formed XML with a mapping you can see and tune — offline.

Your data is processed entirely in your browser and is never uploaded.

Tool workspace

INPUT JSON

Drag & drop file here or browse

JSON Status: Empty0 chars

Options

Each array entry is wrapped in this tag.

Local sandbox active
OUTPUT XML
Output: Empty0 chars
Docs · JSON → XML

Generating XML from JSON

JSON → XML takes a JSON object or array and builds a well-formed XML document from it. Every property becomes an element; nested objects become nested elements; arrays become repeated elements. You can control how attributes are handled (prefixing keys with `@`), how empty elements are treated, and whether to pretty‑print the output. The conversion runs locally, with no external dependencies.

Things to know

Root element

The root of your JSON must be an object with a single key that becomes the root element name. If your JSON is an array, the root element name must be specified via the 'rootName' option (we can add that later).

Attributes

Keys starting with `@` are treated as attributes. For example, `{ "@id": "123" }` becomes `<element id="123"/>`. Enable or disable this with the 'Include attributes' option.

Empty elements

An empty object or a null value becomes an empty element (e.g., `<tag></tag>`). The 'Include empty elements' option can suppress them.

Arrays

An array of objects becomes repeated elements with the same name. If you want a single element to contain multiple children, use an array.

Try these

Simple object
{ "book": { "title": "The Hobbit", "author": "J.R.R. Tolkien" } }

A basic JSON object with a root element.

With attributes
{ "book": { "@id": "978-0-547-92522-8", "title": "The Hobbit" } }

Attributes are marked with @ prefix.

Arrays and nesting
{ "books": [ { "title": "The Hobbit" }, { "title": "The Lord of the Rings" } ] }

Arrays become repeated elements.

pair this withReverse it → XML → JSON·Format the JSON → JSON Formatter·Validate the JSON → JSON Validator

HOW IT WORKS

Convert JSON to XML in three steps

Paste or upload

Drop in any JSON — validity is checked as you type, up to 15M characters.

Tune the mapping

Set the root tag and the array-item tag, indentation, and the XML declaration.

Convert & export

Click Convert, then copy or download the XML — and watch the element count.

FAQ

Frequently asked questions

Is my JSON uploaded anywhere?

No. Conversion runs entirely in your browser, in a background worker for large files. Your data never leaves your machine.

How are arrays represented?

Each entry becomes its own element using the "Array item tag" (default item), wrapped in the array's key. So "tags": ["a","b"] becomes <tags><item>a</item><item>b</item></tags>.

Will it round-trip back to identical JSON?

Not always, and we don't pretend otherwise. XML has no native notion of null vs an empty string, or of a number vs the text of that number, so some type information is lost on the way to XML. The mapping is designed to be readable and reversible where it can be.