Skip to content

XML to JSON Converter

Convert XML to JSON. Attributes become @_name keys, repeated elements become arrays, numbers are detected.

Runs in your browserXML → JSON
Loading tool…

Example

Input
<book id="7"><title>Dune</title><year>1965</year></book>
Output
{
  "book": {
    "title": "Dune",
    "year": 1965,
    "@_id": "7"
  }
}

How to use the XML to JSON Converter

  1. Paste or type your XML into the input area, or open a file from your device.
  2. Adjust the options above the editor if the tool offers any.
  3. Review the JSON result, then copy it or download it as a file.

Privacy and limitations

  • Your data is processed on your device and is not uploaded to any server.
  • Comments and processing instructions are not included in the JSON output.

Frequently asked questions

How are attributes and repeated elements represented?

Attributes are prefixed with @_ (id="7" becomes "@_id": "7"). An element that appears more than once under the same parent becomes an array; mixed text is stored under "#text".

Browse all xml converters →