Convertidor XML → JSON
Convierte documentos XML al formato JSON.
Attributes are prefixed with @. Conversion runs entirely in your browser.
Overview
XML is still everywhere — RSS feeds, SOAP payloads, sitemaps, legacy APIs — but
modern tooling wants JSON. This converter parses XML with your browser’s native
DOMParser and emits pretty-printed JSON (2-space indent). Attributes are kept with
an @ prefix, mixed text is stored as #text, and repeated sibling tags become
arrays.
How to use
- Paste your document into the XML field. Conversion runs as you type.
- Read the result from the JSON field. Malformed XML shows an
Invalid XMLerror between the fields instead.
Examples
<user id='1'><name>Alice</name></user>→
{
"user": {
"@id": "1",
"name": "Alice"
}
}
<list><item>a</item><item>b</item></list>→ the twoitemelements merge into the array["a", "b"].
Notes
The mapping is one-way (XML → JSON) and lossy by nature: comments, processing
instructions, CDATA distinctions, and namespace declarations beyond plain attribute
form are not carried over. An element with neither attributes nor children converts
to a plain string, so <port>8080</port> yields "8080" — a string, not a number.