๐Ÿ”ง Utility Tools

XML to JSON Converter

Convert XML documents to clean JSON. Handles attributes, nested elements, and text content. Everything runs in your browser.

๐Ÿ”ฅ Used 6,318 times this month
XML Input
JSON Output
๐Ÿ“Œ Embed this tool
<iframe src="https://toolifycore.com/tools/xml-to-json.html" width="100%" height="700" frameborder="0"></iframe>
๐Ÿ’ก Ctrl+D to bookmark for next time
๐Ÿ’ก Developer? Get more tools on our blog
Visit Blog โ†’

How it works

01

Paste XML

Copy XML from a file, API response, or config.

02

Set Options

Toggle attribute preservation and formatting.

03

Copy JSON

Clean JSON ready for JavaScript, Python, or any API.

Frequently asked questions

How are XML attributes handled?
By default, attributes are preserved as keys prefixed with @. For example <book id="1"> becomes {"book":{"@id":"1"}}. Turn off "Preserve attributes" to skip them.
What about repeated elements?
When multiple sibling elements share a name, they are converted to an array. Single occurrences stay as objects for cleaner output.
Does it validate XML?
Yes. Uses the browser's built-in DOMParser. Malformed XML produces a clear error message pointing to the problem.
Is my XML uploaded?
No. All parsing runs in your browser.
All tools are free, browser-based, and process files locally. Read our Privacy Policy | Visit our blog.