Convert XML to JSON Online
XML is still the backbone of SOAP APIs, RSS feeds, enterprise integrations, and many government data formats. When you need to work with that data in JavaScript, Python, or any JSON-native environment, converting XML to JSON is the first step.
JConvert parses complex XML structures — including nested elements, attributes, and CDATA sections — and produces clean, hierarchical JSON that mirrors the original document structure.
No server involved. Paste your XML, convert, and get JSON instantly.
What this converter does
The converter uses fast-xml-parser to parse your XML document into a JavaScript object, then serializes it as pretty-printed JSON. Elements become object keys, repeated elements become arrays, and text content becomes string values.
External entity resolution is disabled, making the parser immune to XXE (XML External Entity) attacks — a critical security consideration when handling untrusted XML.
Common use cases
- Converting SOAP API responses to JSON for modern REST-based clients
- Parsing RSS or Atom feeds into JSON for web applications
- Transforming legacy XML data exports into JSON for NoSQL storage
- Processing government or financial XML data (XBRL, HL7, SAML) in JSON-native tools
- Migrating XML-based configuration files to JSON format
How to use JConvert
- Paste or upload your XML document on the converter page.
- Click Convert — the XML is parsed and the JSON structure appears immediately.
- Download or copy the JSON for your application.
Notes and limitations
- XML attributes are included in the JSON output as properties (configurable prefix).
- Repeated sibling elements with the same tag name are automatically converted to arrays.
- XML namespaces are preserved in element names but not resolved.
- Processing instructions and DTD declarations are ignored.
- Maximum input size is 10 MB.
Privacy and security
The parser runs entirely in your browser. External entity resolution is disabled by design (processEntities: false), preventing XXE attacks. No data is sent to any server, making it safe for parsing sensitive XML documents.
Example
XML input
<?xml version="1.0"?>
<catalog>
<book id="1">
<title>The Great Gatsby</title>
<author>F. Scott Fitzgerald</author>
</book>
<book id="2">
<title>To Kill a Mockingbird</title>
<author>Harper Lee</author>
</book>
</catalog>JSON output
{
"catalog": {
"book": [
{
"title": "The Great Gatsby",
"author": "F. Scott Fitzgerald"
},
{
"title": "To Kill a Mockingbird",
"author": "Harper Lee"
}
]
}
}Ready to convert your data?
Open XML to JSON ConverterFrequently Asked Questions
- How are XML attributes handled?
- Attributes are included as properties in the corresponding JSON object. The exact key prefix depends on the parser configuration.
- Are repeated elements converted to arrays?
- Yes. If multiple sibling elements share the same tag name, they are automatically grouped into a JSON array.
- Is the converter safe from XXE attacks?
- Yes. The fast-xml-parser library does not support DTDs or external entities, making XXE attacks impossible.
- Can I convert JSON back to XML?
- Yes. JConvert supports JSON-to-XML conversion as well. See the JSON to XML tool.
- Does my data leave my browser?
- No. All parsing happens client-side. Your XML documents are never uploaded to any server.