Back to tools
XMLpublic tool

XML ⇄ JSON

Convert XML to JSON and back with a hand-written parser — attributes, CDATA, comments, the XML declaration, and repeated elements that collapse into arrays.

Direction
XML → JSON
Status
Converted
Nodes
8
Local
100% browser

XML input

Elements, attributes, CDATA, comments, declaration

JSON output

Converted

{
  "server": {
    "@_name": "qbcore",
    "@_region": "us",
    "jobs": {
      "job": {
        "@_name": "police",
        "@_label": "Police",
        "grades": {
          "grade": [
            {
              "@_id": "0",
              "@_name": "Cadet",
              "@_salary": "500"
            },
            {
              "@_id": "1",
              "@_name": "Officer",
              "@_salary": "750"
            }
          ]
        }
      }
    },
    "motd": {
      "#text": "Welcome <b>now</b>"
    },
    "enabled": {
      "#text": "true"
    }
  }
}