XML to JSON Converter — Attributes, Namespaces & Formatting
Paste XML and get clean, formatted JSON with attribute handling options. Preserves namespaces and mixed content. Runs in your browser — nothing sent to a server.
Keywords: xml to json, convert xml to json, xml json converter, xml to json online, xml2json, json converter, parse xml, xml parser
Frequently Asked Questions
How are XML attributes handled?
Attributes are preserved with an '@_' prefix by default (e.g., <item id='1'/> becomes {'item': {'@_id': '1'}}). You can also choose to ignore attributes.
What about XML namespaces?
Namespaces are included in the JSON output as part of the element names, maintaining full document structure.
Can I handle mixed content?
Yes, text nodes are preserved with a '#text' key, allowing proper representation of XML mixed content in JSON.
Are there file size limits?
The tool efficiently handles files up to 10MB. Processing happens entirely in your browser.
Is the JSON formatted?
Yes, output is beautifully formatted with customizable indentation (2, 4, or 8 spaces).