Free XML to JSON Converter
Something not working? Report a problem
About the XML ↔ JSON Converter
Convert XML to JSON and JSON back to XML instantly — with pretty-print output and clear error messages for invalid input, all in your browser with no upload.
How to use the XML ↔ JSON Converter
- 1Choose the direction: XML → JSON or JSON → XML.
- 2Paste your document into the input box — the result appears instantly.
- 3Any parse errors are highlighted so you can fix the input.
- 4Click Copy to grab the result.
Frequently asked questions
How are XML attributes handled?
Attributes are placed in a special '@attributes' key inside the element's object. Text content goes into a '#text' key when the element also has child elements or attributes.
Can all JSON be converted back to valid XML?
JSON keys that are valid XML tag names convert cleanly. Keys starting with digits, containing spaces or special characters may produce invalid XML — the converter will still attempt the conversion but warns you.
Is my data uploaded anywhere?
No. Conversion uses the browser's built-in DOMParser and XMLSerializer together with plain JavaScript — nothing leaves your device.
Are XML namespaces supported?
Basic namespaces are preserved in the XML output, but the JSON representation flattens them. Full namespace-aware round-tripping is not guaranteed.