⚡ Fast • Private • Accurate

XML to JSON Converter

Paste your XML or upload a file and instantly convert it into clean JSON. Choose how attributes are handled and switch between pretty-printed and minified output.

Convert XML to JSON

Paste XML Data

JSON Output

Paste or upload XML and click Convert to see JSON.
Elements
Attributes
Max Depth
Output Size

How it works

  1. Paste your XML or upload an .xml file.
  2. Choose attribute handling and pretty/minified output.
  3. Convert to generate JSON instantly. Copy or download it.

Features

  • Converts XML elements, attributes and text into structured JSON.
  • Groups repeated tags into JSON arrays so no data is lost.
  • Configurable attribute handling: @ prefix, plain key, or ignore.
  • Pretty-print or minify the output, copy, download, and clear.
  • Runs entirely in your browser — nothing is uploaded.

Frequently asked questions

What is an XML to JSON Converter?

It transforms XML markup — elements, attributes and text — into an equivalent JSON object that is easier to use in JavaScript, APIs and modern apps.

How are XML attributes represented in JSON?

By default attributes are kept with an @ prefix (e.g. <book id="1"> becomes {"book":{"@id":"1"}}). You can switch to a plain key or ignore attributes entirely.

Do repeated XML tags become a JSON array?

Yes. When the same tag appears multiple times under one parent, those elements are grouped into a JSON array so nothing is lost.

Is my XML data uploaded to a server?

No. Parsing and conversion happen locally in your browser using the built-in DOMParser. Nothing you paste or upload leaves your device.