XML to JSON Converter
Parse XML into JSON, keeping attributes under a prefix you choose and converting numbers and booleans.
Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.
Parse XML into JSON. Attributes are kept under a prefix you choose (default @_), repeated elements become arrays, and numbers and booleans can be converted to real JSON types. Malformed XML is reported with the exact line and column.
Step by step
- Paste or open XML: Any XML file works — RSS, SVG, sitemaps, SOAP responses, configs.
- Set the attribute prefix: Attributes appear as
"@_id": "b1"by default. - Choose type conversion: Convert numbers & booleans turns
<price>9</price>into9instead of"9". - Copy or download: Save the JSON as
data.json.
Handy for
Working with feeds
Turn RSS or sitemap XML into JSON for scripts.
API migration
Inspect SOAP/XML responses in a friendlier format.
Data extraction
Pull values out of XML exports.
Validation
Find the unclosed tag breaking an XML file.
Good to know
Text inside an element that also has attributes appears under
#text.The XML declaration (
<?xml …?>) is ignored in the output.
Questions
Are namespaces supported?
Yes — prefixed names like soap:Body are kept as-is in the JSON keys.
Is my data sent anywhere?
No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.
More Developer Tools tools
- YAML to JSON Converter — Convert YAML (including multi-document files) into JSON using a safe loader that never runs custom tags.
- JSON to YAML Converter — Turn JSON into clean YAML with configurable indentation, ready for config files and Kubernetes manifests.
- XML Formatter & Validator — Indent, minify and validate XML, with the exact line and column of any well-formedness error.
- SQL Formatter — Format SQL for MySQL, PostgreSQL, SQL Server, SQLite, BigQuery and more, with keyword case control.
- HTML, CSS & JavaScript Formatter — Beautify HTML, CSS, JavaScript, TypeScript and JSON with Prettier, running entirely in your browser.
- JavaScript, CSS & HTML Minifier — Minify JavaScript with Terser, CSS and HTML safely, and see exactly how many bytes you saved.