XML to JSON Converter

Convert XML to JSON in your browser: attributes, repeated elements and text are kept. Paste or open a file, and convert JSON back to XML. Free.

Runs in your browser. Your files are never uploaded. How it works

Paste XML from a feed, a SOAP response, a sitemap or a config file and get JSON back. Element names become keys, attributes become keys starting with @, numbers and true/false become real JSON values, and repeated elements become lists.

Two XML products with sku and stock attributes converted to JSON with @sku, @stock and nested price
Attributes become @ keys; the repeated product elements became a list. A 299 KB feed of 3,000 products took 0.1 s.

Press ⇄ to go back from JSON to XML with the same rules, so a round trip keeps the structure.

Frequently asked questions

How are attributes shown in JSON?

As keys with an @ in front: <book id="7"> becomes {"@id": 7}. Text inside an element that also has attributes is kept as #text.

What about repeated elements?

Several <item> elements under one parent become a JSON list. A single one stays an object, which is how most converters handle it; check this if your code expects a list.

More ways to use JSON to CSV

Related tools