55 chars · 1 line
Waiting for input
55 chars · 1 line
Waiting for input
JSON to XML conversion guide
Paste valid JSON into the converter above to create a readable XML document. A single top-level object key becomes the root element, arrays become repeated child elements, and the @attributes and #text conventions can recreate structures produced by the XML-to-JSON direction. This tool is free to use. No account or payment is required.
Last updated
The converter first uses standard JSON parsing. Comments, trailing commas, undefined, and other non-JSON syntax must be corrected before element creation begins.
When the top-level JSON object contains exactly one key, that key becomes the XML root element. Other top-level values use a root wrapper.
An array stored under a property creates repeated sibling elements with that property name. A top-level array becomes repeated item elements under the generated root wrapper.
JSON keys are more permissive than XML names. Invalid element or attribute names are reported rather than silently rewritten, and XML text does not preserve JavaScript number or boolean types without a separate schema.
An object containing a repeated port array becomes nested XML with repeated port elements.
{"service":{"name":"api","ports":{"port":[8080,8081]}}}<service>
<name>api</name>
<ports>
<port>8080</port>
<port>8081</port>
</ports>
</service>Common questions
A JSON object with exactly one top-level key uses that key as the root element; other top-level values use a root wrapper.
Arrays under a property become repeated elements with that property name, while top-level arrays use repeated item elements.
The converter reports the invalid name instead of silently changing the source key.
Debugging a specific XML issue? Browse XML troubleshooting.