Bridge JSON APIs and XML systems
Plenty of systems still speak XML: SOAP services, RSS and Atom feeds, Android resources, Office documents, banking and government interfaces. This converter maps between the two formats using a simple, predictable convention:
- Each JSON key becomes an element:
{"title": "X"}→<title>X</title>. - Arrays become repeated elements with the same name:
{"book": [..., ...]}→ two<book>elements. - Keys starting with
@become attributes:{"@id": "bk101"}→id="bk101". - A
#textkey holds an element’s text when it also has attributes or children. nullbecomes an empty element like<note/>.- Characters such as
&,<and>are escaped, and keys that are not valid XML names (e.g. starting with a digit or containing spaces) are sanitised.
XML → JSON uses the same convention in reverse, so you can round-trip data between the two formats.
How to convert
- Choose JSON → XML or XML → JSON.
- For JSON → XML, set the name of the root element (used when the JSON has several top-level keys or is an array).
- Copy or download the result.
Example
JSON
{"book": {"@id": "b1", "title": "Dune", "price": 9.99}}XML
<?xml version="1.0" encoding="UTF-8"?>
<root>
<book id="b1">
<title>Dune</title>
<price>9.99</price>
</book>
</root>Frequently asked questions
How are JSON arrays represented in XML?
As repeated elements with the key name. A top-level array is wrapped in the root element with each entry as an <item> element.
Why does a single XML element not become an array?
XML has no way to say “this is a list of one”. Repeated elements become arrays; a single element becomes an object or value.
Are namespaces supported?
Prefixed names like soap:Body are kept as-is in both directions. Namespace URIs are not resolved.
Is my data uploaded?
No. Conversion runs in your browser.