The XML / JSON Converter performs bidirectional conversion between XML document structures and JSON data structures. It is suitable for SOAP/XML-RPC API responses, RSS feeds, XML Sitemaps, SVG vector markup, Android layout files, JSON configurations, and API response bodies. When HTML source is pasted, the tool outputs a readable JSON representation of the document structure.
In XML → JSON mode, provide a standard XML document, HTML page source, or XML fragment (e.g. <root><item id="1">Hello</item></root>). In JSON → XML mode, provide a valid JSON object string, and the tool will serialize it into equivalent XML markup.
In XML → JSON mode, the output is a compact JSON object where XML attributes are mapped to _attributes keys, text nodes are mapped to _text keys, and child elements are nested as same-name properties. When pasting HTML source, the output includes a complete DOM JSON tree with documentType and root nodes. In JSON → XML mode, the output is readable XML text with 2-space indentation.
For XML to JSON, the tool preserves element, attribute, and text-node hierarchy. For JSON to XML, it first checks that the JSON is valid, then generates the corresponding XML markup. Conversion runs locally and input content is not uploaded.
Input example
<catalog>
<book id="bk101">
<title>XML Guide</title>
<price>44.95</price>
</book>
<book id="bk102">
<title>JSON Guide</title>
<price>39.95</price>
</book>
</catalog>Output example
{
"catalog": {
"book": [
{
"_attributes": { "id": "bk101" },
"title": { "_text": "XML Guide" },
"price": { "_text": "44.95" }
},
{
"_attributes": { "id": "bk102" },
"title": { "_text": "JSON Guide" },
"price": { "_text": "39.95" }
}
]
}
}XML allows attributes and child nodes on the same element, while JSON only has key-value structures. Converters usually map attributes to special keys or nested properties, so review attribute-heavy XML carefully.
It is designed for practical API payloads and configuration snippets with nested objects and arrays. Extremely large files may slow the browser, so split huge exports into smaller samples when possible.
No. The conversion runs in the browser, which is useful for private API examples, internal test fixtures, and draft integration notes.