XML to JSON

Turn XML into JSON, keeping attributes, repeated tags and text

  • Runs in your browser
  • Free
  • No sign-up
Loading XML to JSON…

How to use it

  1. Paste your XML into the box, or press Open file.
  2. Choose whether numbers should be turned into JSON numbers.
  3. Copy the JSON, or download it.

Questions

How are attributes written?

An attribute becomes a key that starts with @. So <book id="bk101"> gives {"@id": "bk101"}. Text next to attributes or child tags is stored under #text.

What happens to repeated tags?

A tag that appears more than once inside the same parent becomes a list. A tag that appears once is a single value, so the shape can differ between files.

Are comments and processing instructions kept?

No. JSON has nowhere to put them, so only elements, attributes and text are converted.

How are mistakes reported?

With the line and column, for example a closing tag that does not match, an attribute value without quotes, or text outside the root element.

Is my data uploaded anywhere?

No. The conversion runs in your browser. Your text is not sent to a server.

Is my text sent to a server?

No. Everything happens in your browser. Your text is not uploaded or stored.

Is it free?

Yes, you can use it for free. A subscription removes limits and unlocks premium tools.