JSON to XML

Convert JSON to well-formed XML as you type, with a root element, indentation and valid element names.

Your files stay on your device. Nothing is uploaded.

JSON to XML

Converts as you type · files up to 20 MB

Step 1: Paste or open your JSON

Step 2: Options

XML indent

Used when the JSON is a list or has several top-level keys, as XML needs one root element.

Step 3: Copy or download

How to convert JSON to XML

  1. Paste or open your JSON

    Paste JSON into the first box, or click Open a file. The conversion runs as you type.

  2. Choose the options

    Choose the indent, and the name of the root element used when the JSON needs one.

  3. Copy or download

    Click Copy XML, or Download .xml for a file.

About this tool

How JSON maps to XML

Each key becomes an element and each list repeats its element. Keys that start with @ become attributes, and "#text" becomes the element's text, the same rules XML to JSON uses, so data can go both ways.

One root element

XML needs exactly one root element. If your JSON is an object with one key, that key is the root. A list, or an object with several keys, is wrapped in the root name you choose (root by default), and list entries become <item> elements.

Names XML accepts

XML element names cannot contain spaces or start with a digit. Keys like "first name" become first_name and "2nd" becomes _2nd, so the result always opens in XML tools. Letters of any language, such as Urdu, are allowed.

Privacy

This tool runs in your browser, on your own device. Your files and text are not uploaded to our server and we cannot see them. When you close or reload this tab, they are cleared, along with the results.

Frequently asked questions

My JSON shows an error

The message gives the line and column of the first problem, such as a missing comma or a trailing comma, which JSON does not allow.

Are numbers kept exactly?

Numbers keep their value (1.50 is written as 1.5), and numbers with more than 15 digits, such as long IDs, keep every digit.

Is my data sent anywhere?

No. The conversion runs in your browser.

Is there a size limit?

Files up to 20 MB.