XML to JSON Converter
Convert XML to JSON for free — paste XML or open a file (RSS, SVG, KML, GPX, config files) and get clean, readable JSON instantly. Attributes are kept with a prefix you choose, repeated elements become arrays, mixed text is kept as “#text”, and numbers and true/false can be converted to real JSON types. Errors in the XML are pointed out clearly.
100% private — everything runs in your browser. Conversion happens on your device; nothing is uploaded.
Attributes become keys with your chosen prefix, text next to child elements becomes “#text”, and repeated elements become arrays. Parsed with your browser’s built-in XML parser; nothing is uploaded.
How to convert XML to JSON
- Paste your XML or click Open file.
- Choose the attribute prefix, indent and type options.
- Read the JSON as you type.
- Copy it or download the .json file.
What you can use it for
- Use XML API responses and feeds in JavaScript apps
- Migrate legacy XML configs to JSON
- Inspect RSS, sitemap, KML and GPX files
- Prepare XML data for NoSQL databases
More free tools
Building for the web?
Format, minify, convert and generate code with our free, private developer tools.
See all free tools →Frequently asked questions
How are XML attributes converted?
Each attribute becomes a key with a prefix — by default “@”, so <book id="1"> becomes {"@id": 1}. You can switch the prefix to _ or -.
What happens to repeated elements?
Elements that appear more than once become a JSON array. Tick “Always use arrays” if you need every child as an array for a consistent structure.
Why is my XML invalid?
Common causes are an unclosed tag, an unescaped & (use &), or more than one root element. The error message shows what the parser found.
Is my data uploaded?
No. It's converted in your browser — nothing is sent to a server.