Convert XML to JSON and Back

Two-way conversion between XML and JSON. Attributes, nesting and repeated tags are preserved.

XML → JSON
JSON → XML
⇄ Swap
XML
JSON
{ "root": { "name": "IConverter", "tools": { "tool": [ "password", "case" ] }, "active": true } }

The XML ⇄ JSON converter translates data between the two most common data-interchange formats. XML shows up in older APIs, config files and RSS/SOAP, while JSON is the default for modern REST APIs. Paste in XML and get JSON back, with attributes turned into "@_name" keys and repeated tags collected into arrays. Or go the other way: a JSON object with a single root key becomes a valid XML document.

Handy for debugging integrations, migrating configs between systems, or just reading an unfamiliar XML structure in a more compact form.

Everything runs in your browser — no data is sent anywhere. Invalid XML or JSON gets a clear error message explaining what's wrong.

Frequently asked questions

Each attribute becomes a key prefixed with @_, e.g. <item id="1"> → {"@_id": "1"}. This keeps attributes distinct from child elements.
If a parent has several tags with the same name, they're collected into a JSON array: <item>a</item><item>b</item> → {"item": ["a", "b"]}.
XML always has exactly one root element. So JSON being converted to XML must be an object with a single top-level key, not an array or a primitive value.