About the XML to JSON Converter
The XML to JSON Converter parses XML with your browserโs built-in XML parser and converts it to JSON. Child elements become keys, repeated elements become arrays, attributes are kept under "@attributes", and text in elements that also have attributes or children is stored as "#text".
How to use the XML to JSON Converter
- Paste well-formed XML.
- Copy the JSON, or read the parser error if the XML is malformed.
Example
Attributes
<item id="7">Pen</item> becomes {"item": {"@attributes": {"id": "7"}, "#text": "Pen"}}.
Frequently asked questions
Are numbers converted?
No. Text content is kept as strings.
What about namespaces?
Prefixed names such as
dc:title are kept as written in the key.
Why do I get a parser error?
The XML is not well-formed, for example an unclosed tag or an unescaped &.