Skip to content

Convert XML to JSON

Convert an XML document to JSON, with syntax error detection.

Processed on your device. Nothing is sent to any server.

Convert an XML document to JSON, detecting syntax errors before attempting the conversion.

Validates the XML's structure and converts it to an equivalent JSON object, representing attributes with a distinctive prefix to tell them apart from element content.

Use cases

  • Converting an old API's XML response to work with it as JSON.
  • Debugging an XML document's structure.
  • Migrating data from an XML format to JSON.

How it works

  1. 1

    Paste your XML

    Type or paste the XML document into the input box.

  2. 2

    Convert it

    Click Convert and copy or download the resulting JSON.

Frequently asked questions

What happens to XML attributes?
They're represented as keys with an @_ prefix inside the JSON object, to distinguish them from child element content.
Data