What this tool does
Each element becomes a key; its children become the value.
<user id="1"><name>Ada</name></user>
{ "user": { "name": "Ada", "@_id": "1" } }
Three places the models disagree
XML and JSON do not describe the same shapes, and every converter has to pick. These are the picks.
Attributes
They become keys prefixed @_. JSON has one kind of member; XML has attributes and elements, and they can share a name — <user id="1"><id>2</id></user> holds two different things both called id. The prefix keeps them apart. A toggle drops attributes if you do not need them.
When an element carries both text and attributes, the text lands under #text.
Repetition
One <item> gives an object. Two give an array.
<r><i>1</i></r> → { "r": { "i": 1 } }
<r><i>1</i><i>2</i></r> → { "r": { "i": [1, 2] } }
This is not a flaw that could be fixed; nothing in an XML document says whether an element is repeatable. Only a schema knows. If your code needs a list, normalise it on arrival.
Mixed content
This one JSON simply cannot express, and it is worth being blunt about.
<p>Hello <b>world</b> again</p>
JSON has no way to say that Hello came before <b> and again after it. The text runs are gathered under #text and their position relative to the elements is lost, along with the spacing between them. If the text is what matters — a document rather than a record — convert nothing and use the XML formatter instead.
Types
<a>1</a> gives the number 1. <a>007</a> gives the string "007", because a leading zero is usually a ZIP code or an account number, and reading it as seven loses it. A twenty-digit identifier also stays a string: a JSON number would round it.
What is not data
The XML declaration and any processing instruction are dropped. They describe the document, not its contents — a ?xml key sitting beside your root element was never information you asked for.
Private by design
Everything runs locally in your browser with JavaScript. Your data is never uploaded, which makes the tool safe for sensitive content, and it keeps working offline.