We use essential storage to make the site work. If you accept, we also use Google Analytics to understand usage and Google AdSense to show ads, which may set cookies. You can change your choice any time with Cookie settings in the footer. Privacy Policy
XML to JSON Converter
Convert any well-formed XML to clean JSON in your browser. Handles attributes, arrays, namespaces. Free and private. 100% free, private, and browser-based.
How to use
Paste XML — Drop any well-formed XML — SOAP, RSS, sitemap, config.
Choose Options — Keep XML attributes as @attributes; toggle pretty indent.
Copy JSON — Use the JSON in your app, API, or spreadsheet.
Frequently asked questions
How are XML attributes represented?
Attributes are placed under a special '@attributes' key on the element, following the common XML→JSON convention used by libraries like xml2js. Toggle this off to drop attributes.
What if two child elements share a tag name?
They are automatically collected into an array. For example, two <book> children become an array of book objects, preserving order.
Are CDATA and comments preserved?
CDATA contents are returned as plain text. Comments and processing instructions are stripped (standard XML→JSON behaviour).
What does '#text' mean in the output?
When an element has both attributes and text content, the text is placed under '#text'. This avoids collisions with the '@attributes' object.
Does it handle XML namespaces?
Yes — preserved as `@xmlns:prefix` keys in the output.
What about mixed content?
Emitted as an array of text and element entries; check the docs in the SEO content above.
Is my XML uploaded?
No — parsing runs entirely in your browser.
Will it validate against a schema?
No — for XSD validation use a dedicated validator. This tool focuses on structural conversion.
Is the output formatted?
Yes — choose 2-space, 4-space, or minified.
The XML to JSON Converter turns any well-formed XML document into a clean JSON tree using the browser's native DOMParser. Use it to migrate legacy XML APIs to modern JSON pipelines, convert RSS feeds for use in JavaScript, or reshape SOAP responses for use in Node.js.
Convention used
Each element becomes a JSON object keyed by its tag name.
Attributes are placed under "@attributes" (configurable).
Repeated child tags become arrays automatically.
Elements with both attributes and text use "#text" for the text content.
Common use cases
Convert RSS/Atom feeds for use in JavaScript apps.
Reshape SOAP responses for REST gateways.
Import OpenDocument or KML data into JSON databases.
Inspect sitemap.xml as a JSON tree.
Privacy
Parsing runs entirely in your browser. Confidential XML — SAML assertions, signed business documents, internal sitemaps — never leaves your device.