XML ↔ JSON Converter

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

206 characters

Frequently Asked Questions

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.
If an XML element has both text and child elements, the text is stored under a special "#text" key in the JSON output.
Absolutely. All processing happens in your browser — no data is sent to any server.
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.