Converters

XML to JSON Converter

Paste XML below to convert it into structured JSON.

What does this tool do?

Paste XML below to convert it into structured JSON. Everything runs locally using JavaScript in your browser — nothing you paste or upload is ever sent to a server.

How to use this tool

  1. Paste your xml input into the left-hand box.
  2. Click Convert to JSON.
  3. Copy the json output from the right-hand box.

Frequently asked questions

How are XML attributes represented in the JSON output?

Attributes are converted to keys prefixed with @, e.g. id="1" becomes "@id": "1", so they stay distinguishable from child elements.

What happens when an element repeats multiple times?

Repeated sibling elements with the same tag name are collected into a JSON array automatically.

What if an element has both text and child elements?

The text content is placed under a #text key alongside the child element keys.