Skip to content
Devtoolry

JSON to XML

Convert JSON to well-formed XML with a configurable root element and attribute support.

About the JSON to XML

The JSON to XML converter produces well-formed XML from JSON, with a root element you choose. Arrays become repeated elements, which is how most XML formats represent lists.

Conversion happens in your browser, so your files and records stay private.

How to use the JSON to XML

  1. Paste JSON.
  2. Set the root element name and indentation.
  3. Copy or download the XML.

Frequently asked questions

How are invalid element names handled?

JSON keys that are not valid XML names (for example ones starting with a digit) are adjusted so the output stays well-formed.

Can I create XML attributes?

Yes. Keys that start with @_ become attributes, so { "book": { "@_id": "1" } } produces <book id="1">.