Home › XML → JSON Converter — Free Online Tool | Wgajaa

⇄ XML → JSON Converter

Parse XML and emit structured, readable JSON. Free, private and instant — nothing you enter is sent anywhere.

About this tool

Wgajaa's XML to JSON converter parses an XML document in your browser and emits structured, readable JSON. Paste XML from an RSS feed, a SOAP response, a sitemap or any legacy system and get a JSON object your modern code can consume.

Attributes are preserved under an underscore prefix, repeated sibling elements become arrays, and text-only elements map to plain strings so the result stays clean. An optional auto-cast converts numbers and booleans, and the status line tells you exactly how many elements and attributes were found.

How this tool works

Everything runs locally in your browser — no data is sent to any server. Here is exactly how it works:

  1. Paste your XML into the left textarea
  2. The JSON output builds automatically as you type
  3. Toggle the auto-cast option to keep or convert numeric-looking values
  4. Copy the JSON output with one click

Frequently Asked Questions

Each attribute is stored as a key starting with an underscore inside the element's object, so <book id="7"> becomes {"book": {"_id": "7", ...}}. This keeps attributes separate from child elements and avoids name collisions.

Sibling elements that share a name are collected into a JSON array. A single occurrence stays an object, so check for arrays when writing code that consumes the output.

Only when auto-cast is on. By default every text value stays a string, which is the safest choice because XML does not carry type information — "007" as a number would lose its leading zeros.

Namespaced tags and attributes keep their literal prefixed names, and CDATA sections are treated as ordinary text. Malformed XML is reported with the browser parser's own error message.

Related Tools

🔒 100% private — runs in your browser
⚡ No uploads — instant results
🆓 Always free — no sign-up
📱 Works on mobile & desktop