Many legacy APIs and data feeds still use XML, but modern applications prefer JSON. This converter transforms XML data into equivalent JSON using the browser's built-in DOMParser. Element attributes are prefixed with @ and text content is stored under #text.

Handles nested elements, repeated elements (converted to arrays), mixed content, and CDATA sections. Everything runs in your browser with no data sent to any server.

Converter

Results

How to Use

  1. Paste your XML into the input field
  2. Click Calculate to convert
  3. Review the JSON output
  4. Copy the JSON for use in your project

FAQ

How are attributes handled?

XML attributes are prefixed with @ in the JSON output. For example, <item id="1"> becomes {"@id": "1"}.

How are repeated elements handled?

When an element appears multiple times at the same level, they are automatically grouped into a JSON array.

Is my XML sent to a server?

No. The browser's DOMParser handles all conversion locally.

Commonly Used With

Pair this tool with others in Developer

People Also Use

Popular tools used alongside this one

Part of These Collections

Curated tool sets for specific workflows