XML to JSON Converter Online

Parse numbers & booleans
Strip namespace prefixes
Remove root wrapper
Input XML
0 / 500,000 characters
Output JSON
Output waiting
Common questions about converting XML attributes, single-element arrays, SOAP namespaces, and CDATA blocks to JSON.

XML to JSON Converter FAQ

XML attributes convert into JSON properties using a configurable prefix such as @_ (Fast-XML standard), @ (BadgerFish convention), or $ (xml2js style). For example, <order id="9042"> becomes "@_id": 9042. You can also select No prefix to merge attributes directly with child keys or Ignore attributes to drop attribute metadata completely.
XML markup does not have dedicated array brackets, so parsers group sibling elements into a JSON array only when the same tag name repeats two or more times. When an XML payload contains only one child item, Auto mode outputs a single object. Switch Array Mode to Always array to wrap single child elements in arrays and avoid TypeError: map is not a function bugs.
Turn on the Strip namespace prefixes switch in the toolbar. This removes xmlns attribute declarations and strips prefixes like soap:, env:, or xs: from every tag name. Pairing Strip namespace prefixes with Remove root wrapper extracts the inner SOAP payload into clean REST JSON keys.
The #text key stores the inner text of an XML element that also carries attributes. Because a JSON string primitive cannot hold nested properties, <price currency="USD">29.00</price> converts into an object with "@_currency": "USD" and "#text": 29. You can change this key name to _text, $t, or value in the Text Node Key dropdown.
Our type parser automatically protects numeric strings with leading zeros (such as "02138" or "004921") and 16+ digit integers as strings even when Parse numbers & booleans is enabled. If your target schema expects every field as a string, disable Parse numbers & booleans.
The converter unwraps <![CDATA[...]]> sections, merges their raw text directly into standard JSON string values, and escapes double quotes and line breaks according to RFC 8259. Standard XML entities like &amp;, &lt;, and &gt; decode into literal characters without double escaping.
Yes. Drag and drop any .xml, .rss, .wsdl, .pom, or .plist file up to 500 KB into the input editor, or click the built-in presets to test RSS 2.0 feeds, XML sitemaps, and SOAP envelopes. Repeated <item> or <url> tags automatically group into a JSON array.
Yes. All XML parsing, tree generation, and JSON serialization run locally inside your browser using native DOMParser APIs. Your XML files, API tokens, and customer payloads never leave your computer or touch an external server.
Disclaimer
All XML to JSON conversion, syntax checking, and tree inspection run strictly inside your browser. No XML files, SOAP payloads, or API credentials are transmitted to or stored on any server.