XML to JSON Converter — Free, Instant, CDATA-Safe
Paste an XML document and get clean JSON in the same second. Attributes, repeated elements and CDATA blocks all survive the conversion, and your file never leaves your browser.
XML Input
JSON Output
Your JSON will appear here the moment you paste XML...
Need the other direction?
Turn JSON back into well-formed XML with the same CDATA-safe engine.
Quick answer: how do I convert XML to JSON?
Paste your XML above or upload an .xml file. This free XML to JSON converter validates the document, maps attributes to @name keys, keeps element text under #text, preserves CDATA under #cdata and turns repeated elements into arrays. Copy or download the JSON — everything runs in your browser, with no signup and no upload.
How XML maps to JSON
Predictable, reversible rules — the same ones our JSON to XML converter reads back.
| XML | JSON | Why |
|---|---|---|
| <item id="1"/> | { "item": { "@id": "1" } } | Attributes keep an @ prefix so they never clash with elements |
| <p class="a">Hi</p> | { "@class": "a", "#text": "Hi" } | Mixed content keeps text under #text |
| <d><![CDATA[<b>x</b>]]></d> | { "d": { "#cdata": "<b>x</b>" } } | CDATA is copied verbatim, never escaped or re-indented |
| two <item> siblings | { "item": [ ... ] } | Repeated names become arrays automatically |
Convert XML to JSON in 3 Steps
Paste or upload your XML
RSS and Atom feeds, SOAP envelopes, sitemaps, SVG, pom.xml — anything well-formed works.
Pick your options
Keep attributes, preserve CDATA, and optionally detect numbers and booleans instead of strings.
Copy or download JSON
Take the JSON straight into your API, test fixture or database import.
Related Tools You Might Need
Discover other powerful data processing tools from our comprehensive suite, ordered by popularity and usage among our users.
CSV to Excel Converter
Convert CSV files to Excel format instantly with our fast, free online tool.
Remove Duplicates
Remove duplicate rows from your CSV data quickly and efficiently.
JSON Beautifier
Format and beautify JSON data with proper indentation and syntax highlighting.
CSV to JSON Converter
Transform CSV data into JSON format with customizable options.
JSON to CSV Converter
Convert JSON data to CSV format for spreadsheet applications.
Merge CSV Files
Combine multiple CSV files into one with smart column matching.
SQL Query CSV
Query CSV data using SQL syntax directly in your browser.
Email Extractor
Extract email addresses from text, CSV files, or any data format.
XML to JSON FAQs
Convert XML to JSON online with attributes, CDATA and text preserved. Paste or upload XML, choose output options and copy or download the JSON.
- Tool
- XML to JSON Converter
- Category
- All JSON tools
- Availability
- Browser-based tool
