XML to JSON Converter
XML to JSON Converter
Paste an XML document and get a clean, pretty-printed JSON output in seconds. Handles nested elements, repeated sibling tags (converted to arrays), text coercion for numbers and booleans, and deeply nested structures. Runs entirely in your browser using the native XML parser — nothing is uploaded.
Where Is This Useful?
How to Use
- Paste an XML document in the input panel
- Click Convert to JSON or press Ctrl+Enter
- Review the JSON output — repeated sibling tags become arrays automatically
- Copy the output or download as a
.jsonfile
Conversion Rules
- XML elements become JSON object keys
- Repeated sibling elements with the same tag become a JSON array
- Text content that looks like a number is coerced to a number
trueandfalsetext nodes become JSON booleans- Leaf elements with no children become their text content value
- Deeply nested structures are supported without depth limits
Frequently Asked Questions
How are XML attributes handled?
The converter focuses on element content and children. XML attributes are not included in the JSON output. If you need attribute mapping, consider a dedicated XML library in your code.
What happens to repeated tags?
When multiple child elements share the same tag name, they are automatically grouped into a JSON array.
Can I convert JSON back to XML?
Yes. Use the JSON to XML Converter to go the other direction.
Is my XML uploaded anywhere?
No. The conversion uses the browser built-in XML parser and runs entirely locally. Your data never leaves your machine.
Related Tools