JSON to XML Converter
Convert between JSON and XML.
🔒 Client · OfflineThe data stays in your browser
Every conversion runs on the page. Nothing is uploaded.
About JSON and XML
This tool converts data between JSON objects and XML elements. All conversions run locally in your browser.
Attribute Prefixes
An XML attribute maps to a JSON key with an @ prefix. The tool writes an @ key as an XML attribute on its parent element.
// JSON:
{ "user": { "@id": "42", "name": "Alice" } }
<!-- XML: -->
<user id="42">
<name>Alice</name>
</user>Text Node Mapping
Text content next to attributes or child elements maps to the #text key. Pure text elements map directly to string values without the key.
// JSON:
{ "link": { "@href": "https://kitdev.space", "#text": "KitDev Hub" } }
<!-- XML: -->
<link href="https://kitdev.space">KitDev Hub</link>Array Serialization
A JSON array maps to repeated XML elements with the same tag name. Repeated child elements in XML parse into a JSON array.
// JSON:
{ "tags": { "tag": ["tools", "developer", "privacy"] } }
<!-- XML: -->
<tags>
<tag>tools</tag>
<tag>developer</tag>
<tag>privacy</tag>
</tags> XML values are text. Booleans and numbers in XML become strings in JSON. Top-level values without an object key get wrapped in a <root> element.