XML to JSON

Convert XML documents to JSON format instantly in your browser. Parses all XML nodes, attributes, and text content into a clean, well-structured JSON object. Preview the output before downloading. Handles complex nested XML structures. No signup required.

Frequently Asked Questions

How are XML attributes handled in the JSON output?
Attributes are included in the JSON output as properties prefixed with '@'. For example, <item id='1'> becomes {"@id":"1"} in the JSON.
Are deeply nested XML structures supported?
Yes. Deeply nested elements are converted to equivalent nested JSON objects and arrays, preserving the full document hierarchy.
How are XML text nodes converted?
Text content is stored under a '#text' key when the element also has attributes or child elements. Simple elements with only text become a direct string value.
Is the conversion done in the browser?
Yes. All parsing and conversion runs locally in your browser. Your XML data is never uploaded to any server.
What if my XML has a namespace prefix?
Namespace prefixes are preserved in the JSON keys (e.g., 'ns:element'). Namespace declarations (@xmlns) are also included as properties.