XML to JSON Converter - Convert XML to JSON Online
Convert XML to JSON with attributes as @attr keys and text content as #text
Developer Tools
XML to JSON Converter - Convert XML to JSON Online
How to Use
1Paste your XML into the input area
2The JSON output appears instantly
3XML attributes become @attributeName keys
4Text content becomes a #text key when mixed with child elements
Frequently Asked Questions
XML attributes are prefixed with "@" in the JSON output. For example, <item id="1"> becomes { "@id": "1" }. This convention avoids conflicts with element names.
When multiple sibling elements share the same tag name, they are grouped into a JSON array. A single element is converted to a plain object.
This tool works entirely in your browser using the DOMParser API. Performance depends on your browser and device. For extremely large files (several MB), consider a server-side tool.
XML and JSON have fundamentally different data models. XML supports mixed content (text and elements together), comments, and processing instructions, which do not map directly to JSON structures.