b2KIT

XML to JSON Converter

Parse XML documents and convert them to equivalent JSON structure with attributes.

Attributes mapped as @_name, text content as #text
{
  "catalog": {
    "book": [
      {
        "@_id": "bk101",
        "author": "Gambardella, Matthew",
        "title": "XML Developer's Guide",
        "genre": "Computer",
        "price": "44.95",
        "publish_date": "2000-10-01"
      },
      {
        "@_id": "bk102",
        "author": "Ralls, Kim",
        "title": "Midnight Rain",
        "genre": "Fantasy",
        "price": "5.95",
        "publish_date": "2000-12-16"
      },
      {
        "@_id": "bk103",
        "author": "Corets, Eva",
        "title": "Maeve Ascendant",
        "genre": "Fantasy",
        "price": "5.95",
        "publish_date": "2000-11-17"
      }
    ]
  }
}
1 top-level key0.6 KB

How to Use XML to JSON Converter

  1. 1

    Paste your XML

    Enter the XML data you want to convert to JSON.

  2. 2

    Convert instantly

    See the JSON output generated automatically from the XML.

  3. 3

    Copy the JSON

    Click copy to grab the converted JSON output.

Related Tools