XML to JSON Converter

Turn XML from feeds, SOAP or config files into JSON — or go the other way.

✓ Runs locally in your browser — nothing is uploaded

In short: An XML to JSON converter maps elements to object keys, repeated elements to arrays and attributes to @-prefixed keys, so XML data can be used in JavaScript and REST APIs.

About XML to JSON Converter

XML and JSON describe the same kinds of data in different shapes, and there is no single official mapping between them. This converter uses a simple, predictable convention: each element becomes a key, elements that repeat become arrays, attributes become keys prefixed with @, and text in an element that also has attributes or children goes in #text.

Going from JSON to XML reverses those rules, so a round trip gives you back equivalent XML. Values that look like numbers or booleans are kept as strings when converting from XML, because XML itself has no types — convert them in your code if you need to.

How to use XML to JSON Converter

  1. Paste XML or JSON.
  2. Press XML → JSON or JSON → XML.
  3. Copy the result. Errors show where parsing failed.

Examples

Attributes and repeats

<list id="7"><item>a</item><item>b</item></list> → {"list":{"@id":"7","item":["a","b"]}}

JSON to XML

{"user":{"@id":"1","name":"Ada"}} → <user id="1"><name>Ada</name></user>

Frequently asked questions

Why is a single element not an array?

The converter only creates an array when an element repeats. If your code always expects an array, wrap single values when reading.

What happens to namespaces?

Prefixed names such as soap:Envelope are kept as-is in the keys, and xmlns declarations become @xmlns attributes.

JSON to XML needs a single root?

XML must have exactly one root element. If your JSON has several top-level keys, they are wrapped in a <root> element.

Is my data uploaded?

No. Conversion happens in your browser. You can check this yourself: open your browser’s developer tools, switch to the Network tab and use the tool — no request carries your input.

Updated November 2026 · Free, no signup · How we build and test tools

Related tools All developer tools →