Skip to main content

XML to JSON Converter

Runs locally

Parse XML documents into clean JSON with attribute, namespace and array controls.

What is XML to JSON Converter?

Convert XML, SVG, RSS, and SOAP payloads into structured JSON using fast-xml-parser. Control attribute prefixes, text node keys, whitespace trimming, and namespace removal.

How to use XML to JSON Converter

  1. Step 1

    Paste XML into the input panel or drop an .xml file.

  2. Step 2

    Configure attribute preservation and indentation in Options.

  3. Step 3

    Copy or download the resulting JSON.

Features

  • Fast, spec-compliant XML parsing with fast-xml-parser
  • Preserves XML attributes or ignores them on toggle
  • Optional namespace prefix stripping
  • Detects malformed XML tags with helpful error details
  • Configurable JSON indentation
  • Runs locally in your browser

Example

Input

<user id="1"><name>Ada</name></user>

Output

{
  "user": {
    "@_id": "1",
    "name": "Ada"
  }
}

Extracts element hierarchy and attributes into JSON properties.

Frequently asked questions

How are XML attributes included?

By default attributes are prefixed with @_ (e.g. @_id), or can be disabled in Options.

Does it validate XML syntax?

Yes, unclosed or mismatched tags produce an error before conversion.

Are my XML feeds uploaded?

No, parsing happens inside your browser.

Can it handle RSS or Atom feeds?

Yes, repeated elements like <item> automatically become JSON arrays.