DevTools Kit
Data Tools

XML to JSON Converter

XML is still common in enterprise systems, SOAP APIs, RSS feeds, and older configuration formats, but modern JavaScript and most REST APIs work in JSON. This free XML to JSON converter parses your XML and produces equivalent JSON, preserving element attributes as separate keys so you don't lose information in the conversion. It's useful for debugging an XML API response, migrating legacy XML data into a JSON-based system, or just making XML easier to read. As with every tool here, conversion happens entirely in your browser — your XML document is never uploaded to a server.

Processed entirely in your browser — your files are never uploaded anywhere.

How to use this tool

  1. Paste your XML into the left box, or upload an .xml file.
  2. Click Convert.
  3. Copy the JSON output or download it as a .json file.

Frequently asked questions

How are XML attributes represented in the JSON?
Attributes are included as keys prefixed with "@_", e.g. <item id="1"> becomes {"@_id": "1"}, to distinguish them from child elements.
Is this conversion perfectly reversible?
XML and JSON have different structural rules (e.g. XML allows mixed text and element content, JSON does not), so highly complex XML may not round-trip perfectly. Most typical data XML converts cleanly.
Can I convert a SOAP XML response to JSON?
Yes — paste the XML body of a SOAP response and it will convert to JSON, though deeply nested SOAP envelopes may benefit from further reshaping depending on your use case.
What happens to XML namespaces?
Namespace prefixes are preserved as part of the element and attribute names in the resulting JSON keys, since JSON has no native namespace concept.
Is there a size limit for the XML file?
No artificial limit — since parsing happens in your browser rather than on a server, the practical limit is your device's available memory.