Convert XML documents, RSS feeds, SOAP responses and SVG files into JSON — attributes, nesting and repeated elements handled sensibly.
XML distinguishes elements from attributes, allows the same tag many times in one parent, and cares about document order. JSON has none of those concepts. Any conversion therefore needs conventions — and knowing them prevents surprises downstream.
An attribute becomes a key prefixed with @. Mixed content — text plus child elements — puts the text under #text. A tag appearing twice becomes an array; appearing once, it does not. That last rule is the classic trap: code that assumes an array breaks on single-item documents, so normalise with [].concat(value) when consuming feeds.
RSS and Atom feeds, SOAP envelopes, sitemaps, Android layouts, Office Open XML parts and SVG all parse cleanly. Namespaced tags keep their prefix (dc:creator) as part of the key.
Related: JSON formatter, JSON to YAML, CSV to JSON.
Attributes are prefixed with @ — so <item id="7"> becomes { "@id": "7" }. Element text sits in #text when an element has both attributes and content.
The first occurrence becomes a value; the second turns the entry into an array. This means a list with one item is not an array — check for both shapes when consuming the output programmatically.
Yes — SVG is XML, so it converts fine. It is a handy way to inspect the structure of a complex SVG.
No. Parsing uses your browser’s built-in XML parser, so the file never leaves the tab.
Yes. A qualified name such as dc:creator remains the JSON key dc:creator. The converter does not expand the prefix into its namespace URI, so keep the original XML when namespace declarations matter downstream.