About this tool
JSON and XML both describe structured, nested data, but they come from different eras of the same problem and it shows in how each one is shaped. XML grew out of document markup — it has real attributes on elements, mixed text and child content, namespaces, and a schema language (XSD/DTD) strict enough to validate an invoice format across two companies that have never spoken to each other. JSON came later, built specifically for passing data between a browser and a server with as little ceremony as possible: no closing tags, no attribute syntax, just objects, arrays, and a handful of primitive types. That difference in origin is why the conversion between them is never perfectly mechanical — XML can express things, like an attribute alongside text content on the same element, that JSON has no native concept for.
In practice, the conversion still comes up constantly. Plenty of enterprise systems, SOAP APIs, RSS/Atom feeds, and legacy config formats are XML at the core, while most modern frontends and REST APIs expect JSON. Converting XML to JSON is usually the first step in getting an old feed or a third-party XML API into a JavaScript app or a modern data pipeline. Converting JSON to XML shows up going the other way — generating a payload for a SOAP endpoint, or producing a config file for a system that only accepts XML.
This tool follows the common convention used by most JSON↔XML converters: object keys become element tags, array items repeat the same tag, and a key prefixed with @ becomes an XML attribute instead of a child element. Plain text content on an element with attributes is represented with a #text key. Going from XML to JSON, the same rules apply in reverse — attributes become @-prefixed keys, repeated sibling tags become an array, and element text becomes either the value directly or a #text key when the element also carries attributes or children. Everything runs locally in your browser; nothing you paste is transmitted anywhere.