XML to JSON
Convert XML data to structured JSON with support for attributes and nested elements.
XML Input
JSON Output
Related Tools
Frequently Asked Questions
Paste your XML document and click Convert. The tool parses all elements, attributes, and text content into a structured JSON object. Attributes are prefixed with @ to distinguish them from child elements.
XML attributes are converted to JSON properties with an @ prefix. For example, <book id="1"> becomes {"book":{"@id":"1"}}. This convention keeps attributes clearly separated from child elements.
The tool runs in your browser, so it handles files up to several megabytes comfortably. For very large XML files (100MB+), consider using a server-side tool or streaming parser.
Yes. CDATA content is extracted as plain text values in the JSON output, preserving the original content without the CDATA wrapper syntax.