XML to JSON

Convert XML — including attributes and nested elements — into a clean JSON object you can use in modern code and APIs.

Input
Output
Ad · in-content

About the XML to JSON

Working with XML in JavaScript is awkward; JSON is far more natural. This converter parses XML with the native browser parser and maps elements to keys, attributes to @-prefixed keys, and repeated elements to arrays.

Conversion is local and private. Use it to modernize legacy XML data, inspect a SOAP response as JSON, or feed XML content into JSON-based tooling.

How to use the XML to JSON

  1. 1Paste XML into the editor.
  2. 2Click “Convert to JSON”.
  3. 3Copy the JSON output.

Key benefits

  • Attributes preserved as @-keys.
  • Repeated elements become arrays.
  • Native, accurate parsing.
  • Private and instant.

Real-world examples

Modernize legacy data

Turn XML records into JSON for a new app.

Inspect SOAP

Read a SOAP envelope as JSON.

Frequently asked questions

How are attributes represented?+

Each attribute becomes a key prefixed with @, e.g. @id.

Related tools

Ad · sticky-mobile