How it works
- Paste JSON or choose a .json file.
- Set the root element name used around the result.
- Convert and inspect the generated XML.
- 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.