XML to JSON
Convert XML to JSON live — decodes XML entities, optionally coerces numbers / booleans / null, and preserves attributes under @attributes.
About this ToolHow it works, benefits & use casesTap to collapse
Parse XML into clean, structured JSON directly in your browser, updated live as you edit. The converter reads elements into nested objects, and when a parent has several children with the same tag it collapses them into an array automatically — so repeated <user> or <item> nodes become a JSON list rather than overwriting one another. XML entities such as &, < and numeric character references like © are decoded back to their real characters. Element attributes are preserved under an "@attributes" key by default, matching the convention the JSON to XML tool consumes so documents can round-trip. An optional type-coercion mode converts unambiguous text values — turning "42" into a number, "true"/"false" into booleans and "null" into null — while leaving everything else as strings. You can also drop attributes entirely if you only care about element content. The result shows how many elements were parsed and can be copied, downloaded as .json, or shared, with no upload.
How to Use
- 1Decide on your options: keep "Coerce types" on to turn numeric, boolean and null text into real JSON types, and toggle "Ignore attributes" if you want to discard XML attributes.
- 2Paste your XML into the input panel — the JSON regenerates live — or click "Load example".
- 3Press "Convert to JSON" to validate the XML.
- 4If the markup is malformed, read the parse error describing what went wrong, then fix the source.
- 5Copy the JSON, download it as output.json, or share it via the generated URL.
Key Benefits
- Collapses repeated same-tag children into JSON arrays automatically
- Decodes named and numeric XML entities back to real characters
- Preserves attributes under "@attributes" for round-tripping with JSON to XML
- Optional type coercion: numbers, booleans and null instead of strings
- Option to ignore attributes when you only need element content
- Reports the number of elements parsed; copy, .json download and sharing
- Entirely client-side — your XML never leaves the browser
Common Use Cases
- Consuming a legacy or SOAP XML API as JSON in a JavaScript app
- Converting an RSS or sitemap feed into JSON for processing
- Extracting structured data from a configuration or export file in XML
- Inspecting attribute-heavy XML by viewing it as a JSON tree
- Round-tripping documents alongside the JSON to XML converter
Options
42 → number, true → boolean, null → null
Drop XML attributes entirely
0 characters · live
Paste XML above to see the JSON live.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- Color ConverterConvert between HEX, RGB, HSL, and HSV
- cURL to Code ConverterConvert cURL commands to code in various languages
- JSON Path FinderFind and test JSON paths
- npm to Yarn ConverterConvert npm commands and package-lock.json to Yarn equivalents
- Postman to cURL ConverterConvert Postman requests to cURL commands
- Sitemap Priority CalculatorPaste a list of URLs and get a complete XML sitemap with priorities from a transparent, tunable model — each URL auto-classified by type & depth, with a per-row score breakdown and priority distribution analysis
When a parent element has multiple children sharing the same tag name, those children are grouped into a JSON array under that tag. A single occurrence stays a plain object, so the output reflects the actual cardinality in your XML.
By default attributes are stored under an "@attributes" key on the element's object. This matches the format expected by the JSON to XML tool, so a document converted one way can be converted back. Enable "Ignore attributes" to omit them entirely.

