ToolBirch

XML to JSON

Parse XML into structured JSON with attribute support.Developer Tools

XML to JSON

Parse XML with the browser's DOMParser and emit structured JSON: attributes become @keys, repeated siblings become arrays.

About this tool

Attributes become at-prefixed keys, repeated siblings become arrays, and text nodes stay as strings — parsed by the browser own XML parser with errors reported verbatim.

How to use the XML to JSON tool

  1. Paste the XML. Well-formed documents only.
  2. Convert. The tree becomes nested JSON.
  3. Copy the result. Formatted with two-space indentation.

Supported formats

Input

  • Plain text or file input

Output

  • Converted or analysed output

Inputs are validated before anything is processed. Invalid values and unsupported files are rejected with a clear error instead of failing silently.

Frequently asked questions

How are attributes shown?

As keys prefixed with an at-sign on the element object.

What about repeated elements?

They collapse into arrays automatically.

Are namespaces preserved?

Prefixes appear verbatim in key names; no URI resolution.

Privacy

Everything you enter stays in this browser tab. There is no upload endpoint for tool inputs, no account, and no server-side copy of your text or files. Results are produced locally and disappear when you close the page.

No account is required and no file is ever uploaded. See the privacy policy for details about analytics and the limited data this site stores.

Known limitations

  • Comments and processing instructions are dropped.

Other free tools from the same collection.