Skip to content
Cifrivo
Developer

Convert JSON to XML

Turn JSON objects and arrays into escaped XML, choose a valid root element and download the result without uploading data.

Processed locallyYour files never leave your device.

Everything is processed locally in your browser.

How it works

  1. Paste JSON or choose a .json file.
  2. Set the root element name used around the result.
  3. Convert and inspect the generated XML.
  4. Copy or download the XML file.

Practical example

With root catalog, {"book":[{"title":"Tools"},{"title":"Web"}]} creates two sibling <book> elements inside <catalog>.

Formula and explanation

Object keys become element names and array items repeat the same element. Primitive values become escaped text, while null produces an empty self-closing element.

For a controlled round trip, @attributes supplies attributes and #text supplies direct text. Characters such as &, < and quotation marks are XML-escaped so data cannot accidentally break markup.

XML element names have stricter rules than arbitrary JSON keys. The converter rejects invalid names rather than silently changing them. You can transform such keys before conversion. Everything runs locally.

Frequently asked questions

How are JSON arrays converted?

Each item becomes a repeated XML element using the array property's name.

Can JSON keys contain spaces?

JSON can, but XML element names cannot. Rename those keys or apply a domain-specific mapping first.

Are special characters escaped?

Yes. Ampersands, angle brackets, quotes and apostrophes are encoded safely for XML.