Developer Tools

JSON to XML

Convert JSON objects and arrays to formatted XML. Handles nested objects, arrays, and special characters — free, browser-based, no uploads.

No uploads — browser onlyInstant result

Root tag name

Indent

JSON Input

How to convert JSON to XML

  1. Paste your JSON into the input area.
  2. Set the root element tag name (defaults to root).
  3. Choose indentation (2 or 4 spaces).
  4. Click Convert to XML, then copy or download the result.

How arrays and null values are handled

JSON arrays produce repeated XML elements with the same tag name. JSON null values produce self-closing tags with an xsi:nil="true" attribute. JSON keys that are not valid XML names (e.g. start with a digit) are sanitised automatically.

Privacy — processed in your browser

Conversion runs entirely in JavaScript in your browser. No data is sent to any server.

Frequently Asked Questions

What happens if my JSON key is not a valid XML tag?

Keys are sanitised — leading digits are removed, and invalid characters are replaced with underscores. The tag falls back to "item" if the key produces an empty string.

Can I convert an array at the top level?

Yes — a top-level JSON array produces repeated child elements inside the root tag.

Does this add an XML declaration?

Yes — the output always starts with <?xml version="1.0" encoding="UTF-8"?> followed by the root element.

Related tools