Code Tower · room 20
XML to JSON
Convert XML to JSON.
🔒 Processed in your browser · No upload · No sign-up
Convert XML to JSON
Paste XML from an API, an RSS / Atom feed, a sitemap or a config file and get JSON you can use directly in JavaScript. The XML is validated first, so malformed input is reported with its line and column.
How are attributes and text handled?
Attributes become keys with the chosen prefix (@_id). When an element has both attributes and text, the text is stored under #text. Repeated elements with the same name become arrays.
Why is a value sometimes an object and sometimes an array?
An element that appears once is converted to a single value, while one that repeats becomes an array. Enable "Always use arrays" if you need a consistent shape — every element (except the root) is then wrapped in an array.