How to Convert XML to JSON Online
- Paste XML or open an .xml file.
- Choose array, typing and namespace options.
- Copy or download the JSON.
XML to JSON Converter Features
- Attributes and arrays: custom attribute prefix and automatic arrays for repeated tags.
- Typed values: numbers and booleans, or keep everything as strings.
- Namespace removal: strip prefixes like soap: or atom:.
- XML validation: error line and column for malformed XML.
- Free forever: no trial, no paywall and nothing added to your files.
- Privacy-first: files and text never leave your computer or phone.
- Nothing to install: a modern browser on PC, Mac, tablet or phone is all you need.
How XML Maps to JSON
| XML | JSON |
|---|
| <price>44.95</price> | "price": 44.95 |
| <book id="bk101"> | "book": { "@id": "bk101" } |
| Two <book> elements | "book": [ {…}, {…} ] |
| Text next to child elements | "#text": "…" |
| <empty/> | "empty": null |
Choosing the Options
“Smart” output is the most readable, but the shape of the JSON can change when a list has only one item (an object instead of an array). If code will read the JSON, choose “Always use arrays” so every element is a list, or “Keep all values as strings” to avoid numbers like ZIP codes losing their leading zeros.
Who Uses the XML to JSON Converter?
- Developers consuming SOAP or legacy XML APIs
- Converting RSS feeds and sitemaps
- Data analysts moving XML exports into JSON tools
See also: JSON to XML (the reverse conversion).
Frequently Asked Questions
Why did my ZIP code lose its leading zero?
Smart mode turns numeric text into numbers. Switch to “Keep all values as strings” to keep values such as 02134 exactly.
Can it convert RSS and Atom feeds?
Yes. Paste the feed XML; enable “Remove namespace prefixes” for cleaner keys such as title instead of atom:title.
What about CDATA sections?
CDATA content is treated as text and included in the value.
Does it handle large files?
Files of several megabytes work in modern browsers; very large files depend on your device’s memory.
Is my data uploaded?
No. The conversion runs in your browser with JavaScript, so your files and text stay on your device. Nothing is sent to our server.
Is there a standard way to convert XML to JSON?
No single standard exists, which is why tools differ. This converter follows the common convention of prefixed attributes, arrays for repeated elements and a #text key for mixed content, and lets you change the prefix and text key to match the format your code expects.