XML to JSON Converter
Convert XML to formatted JSON with support for attributes, CDATA, nested elements, and multiple children. Free, private, instant.
How It Works
Paste XML
Copy and paste any XML document into the input area. The sample provides a realistic example with nested elements and CDATA.
Auto-Convert
The XML is parsed and converted to JSON instantly as you type. Attributes get an @ prefix and text nodes use #text.
Review JSON
The formatted JSON output is pretty-printed with 2-space indentation. Nested structures and arrays are clearly visible and easy to navigate.
Copy or Download
Copy the JSON to your clipboard with one click, or download it as a .json file for use in your projects.
About XML to JSON Converter
Convert XML documents to clean, structured JSON format instantly using browser-native DOMParser. This tool follows the standard xml2json convention — attributes are prefixed with @, text content is stored in #text when mixed with child elements, and multiple child elements with the same name are grouped into arrays. CDATA sections are treated as text content. The JSON output is pretty-printed with 2-space indentation for readability. All processing happens in your browser — no data is sent to any server.
Attribute Support
XML attributes are preserved with the standard @ prefix convention. Multiple attributes on one element are all included as separate keys.
CDATA Handling
CDATA sections are treated as text content and included in the output. The raw text inside CDATA sections is preserved without parsing.
Nested & Array Support
Deeply nested elements become nested objects. Repeated element names at the same level are automatically grouped into arrays.
100% Private
All conversion happens in your browser using native DOMParser. No data uploaded to any server. Works offline after page load.