XML to JSON
Convert XML documents into structured JSON online. Automatically maps XML attributes to `@_attribute` properties, groups repeated sibling elements into JSON arrays, and preserves text nodes.
Interactive workspace loading...
How to Use XML to JSON
Key Features
Common Use Cases
- Transforming legacy SOAP API responses into lightweight JSON for mobile and frontend web apps.
- Ingesting XML RSS and Atom news feeds into JavaScript modern frameworks (React, Vue, Svelte).
- Converting XML sitemaps or catalog files into database-ready JSON records.
- Migrating XML configuration files into modern JSON or NoSQL data stores.
Frequently Asked Questions
To prevent name collisions between child elements and tag attributes, attributes are prefixed with `@_` (for example, `<book id="1">` becomes `{ "book": { "@_id": "1" } }`).
When multiple sibling tags share the same name (such as multiple `<item>` tags inside `<catalog>`), the converter automatically collects them into a single JSON array (`[ ... ]`).
When an XML element contains both attributes and inner text (e.g. `<user role="admin">Alice</user>`), the text is assigned to a `#text` property: `{ "@_role": "admin", "#text": "Alice" }`.