100% client-side — files never leave your device

XML to JSON

Convert XML documents, RSS feeds, SOAP responses and SVG files into JSON — attributes, nesting and repeated elements handled sensibly.

How it works

  1. Paste or open the XML. Feeds, API responses, configuration files or SVG artwork.
  2. Inspect the JSON. Attributes appear as @name keys, text content as #text, repeated tags as arrays.
  3. Copy or download. Take the JSON straight into your editor or save it as a file.

Two models that do not map perfectly

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.

The conventions used here

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.

Common sources

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.

Frequently asked questions

How are attributes represented?

Attributes are prefixed with @ — so <item id="7"> becomes { "@id": "7" }. Element text sits in #text when an element has both attributes and content.

What happens with repeated tags?

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.

Can it convert an SVG file?

Yes — SVG is XML, so it converts fine. It is a handy way to inspect the structure of a complex SVG.

Is my document uploaded?

No. Parsing uses your browser’s built-in XML parser, so the file never leaves the tab.

Are XML namespace prefixes preserved?

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.

Related tools