What does the XML to JSON Converter do?
An XML to JSON converter turns each element into a JSON key, repeated elements into arrays and attributes into keys prefixed with @_. Numbers and booleans are detected automatically. It is the quickest way to consume SOAP responses, RSS feeds or XML configs in JavaScript.
How to use the XML to JSON Converter
- 1
Paste your xml
Paste or type xml into the input box, open a file from your device, or click Sample to load an example.
- 2
Adjust the options
Set attributes to match what you need.
- 3
Copy or download the result
Review the json on the right, then copy it to the clipboard or download it as a .json file.
XML to JSON Converter example
<catalog>
<book id="b1" lang="en">
<title>Clean Code</title>
<price>29.99</price>
</book>
<book id="b2" lang="en">
<title>Refactoring</title>
<price>34.5</price>
</book>
</catalog>{
"catalog": {
"book": [
{
"title": "Clean Code",
"price": 29.99,
"@_id": "b1",
"@_lang": "en"
},
{
"title": "Refactoring",
"price": 34.5,
"@_id": "b2",
"@_lang": "en"
}
]
}
}When to use it
- •Consuming SOAP or legacy XML APIs in a JavaScript app
- •Converting sitemaps and RSS feeds for processing
- •Migrating XML config to JSON
Why use this xml to json converter
- 100% free, no signup or login
- Runs locally: your data never leaves the browser
- Instant results with clear error messages
- Works on desktop, tablet and mobile
- Copy to clipboard or download in one click
- No watermarks and no usage limits
Frequently asked questions
How are XML attributes represented?+
Attributes become keys prefixed with @_ (for example "@_id": 5). Choose "Ignore" in the options to drop attributes entirely. Mixed text content is stored under #text.
Is the XML to JSON Converter free?+
Yes. The XML to JSON Converter is 100% free with no signup, no login, no usage limits and no watermark. It works on desktop and mobile browsers.
Is my data uploaded when I use the XML to JSON Converter?+
No. The XML to JSON Converter runs entirely in your browser with JavaScript. Nothing you paste or upload is sent to our servers, logged or stored.
Last updated by the Imaginex AI team.