JSON1

JSON1 / JSON to XML

JSON to XML

Convert JSON to indented XML. Arrays repeat the parent tag, nulls become xsi:nil, and keys that are not legal element names are sanitised.

Processed locally
InputJSON
Ready
OutputXML

Converted output appears here as you type.

About this tool

XML is still what many enterprise systems, SOAP services, and document formats expect. Converting JSON to XML means resolving a structural mismatch: JSON has arrays and a real null, XML has neither.

Arrays repeat the parent tag once per element, nulls become an element carrying xsi:nil="true", and any key that is not a legal element name is sanitised. A root-level array is wrapped in <item> elements, because a document with several top-level elements is not well-formed XML.

Why is my array not visible as an array?
XML has no array type. A list of three items becomes the same element three times over, which is the conventional encoding — but it does mean a one-element array and a plain value look identical in the output.
What happens to a key like "first name" or "2fa"?
Element names cannot contain spaces or start with a digit, so those are rewritten to something legal. The conversion is not reversible for such keys, which is worth knowing before using this as a storage format.