JSON to XML Converter

Paste JSON and get well-formed, indented XML with arrays as repeated elements. Nothing you paste leaves your browser.

About the JSON to XML Converter

Convert JSON to XML online. The document is wrapped in a root element, each key becomes an element, arrays repeat their element once per item, and special characters are escaped. Keys that are not valid XML names are made valid automatically.

How to use it

  1. 1Paste your JSON, or upload a .json file.
  2. 2The XML appears on the right as you type, using the indentation you choose.
  3. 3Copy it, or download it as an .xml file.

Frequently asked questions

How are arrays converted?

An array under a key repeats that element once for each item, so {"tag": ["a", "b"]} becomes two <tag> elements. A top-level array becomes repeated <item> elements inside <root>.

What happens to keys with spaces or that start with a number?

They are made into valid XML names: spaces and other invalid characters become underscores, and a name that cannot start an element gets a leading underscore - "first name" becomes first_name and "2fa" becomes _2fa.

How is null converted?

As an empty element, such as <notes/>.

Is my JSON sent to a server?

No. Everything runs in your browser. Nothing you paste or upload is sent anywhere, logged or stored, so it is safe to use with API responses and config files.

Why do large numbers stay exactly as I wrote them?

Most online formatters convert your text to JavaScript numbers and back, which silently rounds anything beyond 2^53 - an ID like 12345678901234567890 becomes 12345678901234567000. This tool keeps every number, escape and key exactly as written and only changes the spacing.