XML to JSON Converter

Convert XML documents to clean JSON — attributes preserved, repeated tags grouped, namespaces tamed.

Advertisement

How XML maps to JSON

XML and JSON don't have a single universal mapping, so this converter follows the most common conventions: nested elements become nested objects, repeated sibling tags are grouped into arrays, and attributes are kept as @name keys so they never get confused with child elements. Namespace prefixes (soap:Body) are stripped to local names. An element that holds only text collapses to that text value — unless it also has attributes, in which case the text lives under #text.

FAQ

How are XML attributes represented in JSON?
Attributes become keys prefixed with @, e.g. <item id="7"> becomes {"@id": "7"}. You can turn attribute inclusion off with the checkbox.
What happens with repeated XML tags?
Sibling elements with the same tag name are automatically grouped into a JSON array, so <row>…</row><row>…</row> becomes "row": [ {...}, {...} ].
How are XML namespaces handled?
Namespace prefixes are stripped and local tag names are used, so <soap:Body> becomes "Body". This keeps the JSON clean for the common cases.
What if my XML is invalid?
The converter shows the parser's error message so you can fix the XML. Nothing is uploaded — validation and conversion run entirely in your browser.
Advertisement