XML to JSON
Convert XML into JSON with attributes, text content, and repeated child elements mapped to keys, arrays, and a text field whose name you choose.
How to use
- Paste XML into the input.
- Choose how attributes and text content are named.
- Copy the JSON.
XML to JSON conversion reads an XML document and writes an equivalent JSON structure. Attributes become prefixed keys, repeated sibling elements become an array, and mixed text content lands in a text field.
Paste or type something above.
Questions about xml to json
- How are attributes named?
- They are grouped under an attributes key by default, or each one gets its own at-sign prefixed key. Pick either in the options.
- When does an element become an array?
- When two or more sibling elements share the same tag name. A single child stays an object.
- Does it keep text content?
- Yes. For an element with attributes and text, the text is written to the text field you selected.
Related tools
- JSON Formatter Format minified or badly indented JSON into clean, readable output with your choice of ind...
- XML Formatter Re-indent XML with consistent spacing and readable nesting, keeping the declaration, DOCTY...
- XML Validator Check that XML is well-formed and see the element, attribute, and depth counts, with the p...