XML to JSON Converter

Convert XML elements, attributes and ordered child nodes into a JSON tree.

Workspace

Result

Your result will appear here.

How to use it

  1. Fill in xml.
  2. Select “Convert to JSON” to see the result.

Worked example

Input
<item size="L">Tea</item>
Output
{
  "name": "item",
  "attributes": {
    "size": "L"
  },
  "children": [
    {
      "text": "Tea"
    }
  ]
}

Frequently asked questions

How are XML attributes and repeated elements represented?

Attributes sit under attributes. Repeated elements and text stay in the children array in their original order.