Quick answer: To convert XML to JSON, paste your XML. Elements become keys, repeated elements become arrays and attributes appear with an @ prefix. Invalid XML shows a clear error.
Conversion rules
- Attributes become keys starting with
@. - Text next to attributes or child elements is stored as
#text. - Repeated elements with the same name become an array.
- Empty elements become
null. - Tick Convert numbers and booleans to turn "42" into 42 and "true" into true.
Your files stay private. This tool runs entirely in your browser. Nothing you choose or type is uploaded to a server. See our privacy policy.
Frequently asked questions
How are attributes handled?
They are added as keys with an @ prefix, for example "@id".
Why did I get an error?
The XML is not well-formed, for example a missing closing tag. The message shows the problem.
How do repeated elements work?
They become a JSON array automatically.
Is my data uploaded?
No. It stays in your browser.