JSON / XML Converter
Convert between JSON and XML formats. Toggle direction to go either way.
Related tools
Convert between JSON and XML in either direction in your browser. Keys that start with @ become XML attributes and a #text key becomes the element text, the same convention the XML to JSON direction uses.
Frequently asked questions
How are JSON and XML mapped?
Object keys become XML elements and values become their content; converting back reverses the process into nested objects.
How are attributes handled?
XML attributes are represented with a prefix (such as @) in JSON so they round-trip without colliding with element names.
Can it convert both ways?
Yes — toggle the direction to go from JSON to XML or XML to JSON.
What JSON shape does it need?
One object with exactly one top-level key, which becomes the root element, such as {"note": {"to": "Ada"}}. A top-level array or a bare value is rejected. Inside, arrays become repeated elements with the same name and null becomes an empty element. The XML starts with an XML declaration and uses two-space indentation.