XML ↔ JSON Converter

Convert between XML and JSON formats instantly. Supports attributes, nested elements, and pretty printing.

206 characters

Frequently Asked Questions

How are XML attributes handled?

XML attributes are converted to JSON keys prefixed with "@". For example, <item id="5"> becomes { "@id": "5" }. When converting back, any key starting with "@" is placed as an attribute on the parent element.

What about text content mixed with child elements?

If an XML element has both text and child elements, the text is stored under a special "#text" key in the JSON output.

Is this safe for sensitive data?

Absolutely. All processing happens in your browser — no data is sent to any server.

What if my JSON doesn't have a root element?

JSON-to-XML conversion requires a top-level object whose keys become the root XML element(s). Arrays or primitives at the top level are not valid XML roots.