Skip to main content

JSON to XML Converter

Paste strict JSON and generate a deterministic XML document, entirely in your browser.

JSON and XML have different data models. Empty arrays, empty objects and null values may map to similar empty XML elements.

Processed locally in your browser

How to use it

  1. Paste your strict JSON into the input area
  2. Set the root element name and choose an indentation option
  3. Turn the XML declaration on or off, then select Convert to XML
  4. Review the XML output and use Copy to copy it

You choose the name of the single XML root element ("root" by default); it is never guessed from a JSON key. JSON objects become nested elements whose tag names are the object keys, arrays repeat their property element once per entry, and a top-level array is wrapped in "item" elements under the root. Strings are XML-escaped, booleans and numbers become element text, and null, empty strings, empty objects and empty arrays all map to the same self-closing element. Keys that are not valid XML names are rejected rather than silently rewritten, and characters that XML 1.0 forbids are refused. You can include or omit the XML declaration and pick 2-space, 4-space or compact output. No JSON key is turned into an attribute. Nothing you paste is uploaded, logged or stored. JSON and XML have different data models, so this conversion is not lossless: empty and null values in particular may become indistinguishable.

FAQ

We use cookies to run this site and, with your consent, to understand usage and personalize ads. You can change your choice at any time.