XML to JSON Converter
Convert XML to JSON and JSON to XML in your browser.
JSON
Frequently asked questions
How are attributes represented in JSON?
XML attributes are prefixed with an @ sign (for example @id) and text content sits under a #text key, so no information from the original XML is lost in the conversion.
What happens with repeated elements?
When an element name appears more than once inside the same parent, those entries are collected into a JSON array automatically, preserving their order.
Why does my XML fail to parse?
XML must be well-formed: every tag closed, one root element, and attributes quoted. The tool reports when the input is not well-formed so you can correct it.
Can it convert JSON back to XML?
Yes. Switch direction and it wraps your JSON in XML elements, turning @-prefixed keys back into attributes and #text back into element content.
Is the conversion done locally?
Yes. It uses your browser's built-in XML parser, so the document is never sent to a server.