XML to JSON Converter

Paste XML and convert it to clean, structured JSON

Frequently Asked Questions

How does this tool handle XML attributes? +
XML attributes are converted to JSON properties prefixed with '@'. For example, <book id="1"> becomes {"@id": "1"}. This convention keeps attributes separate from child elements in the output.
What happens with mixed content (text + child elements)? +
When an element has both text content and child elements, the text is stored under a '#text' key in the JSON object. Child elements are stored under their own keys as usual.
Does this converter handle namespaces? +
Yes. Namespaced elements and attributes are preserved in the JSON output with their full prefixed names (e.g., 'soap:Envelope'). The namespace URI is not separately extracted.
What if my XML is invalid? +
The tool uses your browser's built-in XML parser and will show a clear error message if the XML is malformed. Common issues include unclosed tags, mismatched tags, and invalid characters.
Is there a limit on XML size? +
There is no hard limit. Processing happens in your browser, so performance depends on your device. Typical XML documents up to several megabytes convert in under a second.