Small Tools
YAML, XML & Data utility

XML to JSON

Convert XML elements and attributes into a JSON structure.

● This tool runs entirely in your browser. Your input is never uploaded to our servers.
Output
Your result will appear here…

How to use XML to JSON

  1. Paste a well-formed XML document.
  2. Select Convert to map elements and attributes to JSON.
  3. Copy the formatted JSON output.

Example

Input / settings:

<person id="7"><name>Ada</name><active>true</active></person>

Output:

{
  "person": {
    "@attributes": {
      "id": "7"
    },
    "name": "Ada",
    "active": "true"
  }
}

When to use

Overview

Convert XML elements and attributes into a JSON structure.

Supported input

XML text

Output details

JSON

Privacy and security

This tool runs entirely in your browser. Your input is never uploaded to our servers.

Frequently asked questions

How are attributes represented?

Attributes are grouped under an @attributes object.

How are repeated elements represented?

Repeated sibling elements with the same name are collected into arrays.

Are XML values converted to numbers or booleans?

Element text is kept as strings to preserve the source value.

Related tools