79 chars · 1 line
Waiting for input
79 chars · 1 line
Waiting for input
XML to JSON conversion guide
Paste a well-formed XML document into the converter above to map the root element, child elements, attributes, repeated siblings, and significant text into readable two-space JSON. This is useful when an API or development workflow expects JSON rather than XML. This tool is free to use. No account or payment is required.
Last updated
Element names become JSON object keys. Attributes are grouped under @attributes, and significant text uses #text when an element also has attributes or child elements.
When multiple sibling elements share the same tag name, their converted values become a JSON array instead of overwriting one another.
The mapping is designed for practical developer conversion, not lossless XML round-tripping. XML namespaces, mixed-content ordering, comments, processing instructions, and schema types do not have direct JSON equivalents in this representation.
Parsing and conversion happen in the browser. Review the generated structure before using it as an API fixture or application input.
Repeated item elements become an array and XML attributes stay visible under @attributes.
<catalog version="1"><item id="a">Ada</item><item id="b">Linus</item></catalog>{"catalog":{"@attributes":{"version":"1"},"item":[{"@attributes":{"id":"a"},"#text":"Ada"},{"@attributes":{"id":"b"},"#text":"Linus"}]}}Common questions
Repeated siblings with the same tag name become an array under that tag name.
Attributes are stored under an @attributes object so they remain distinct from child elements.
No. The formats have different data models, so review namespaces, mixed content, comments, and type assumptions when exact round-tripping matters.
Debugging a specific XML issue? Browse XML troubleshooting.