Paste XML and get clean JSON in one click — attributes, CDATA, namespaces and repeated elements are handled correctly. Nothing is uploaded, everything stays in your browser.
This XML to JSON converter turns any XML document into a clean, readable JSON object you can use in APIs, scripts or data pipelines. Paste your XML on the left — or open an .xml file directly from your computer — and element attributes become JSON keys, repeated elements are collected into arrays, and CDATA sections, entity references and self-closing tags are all handled correctly. Text-only elements become plain strings, empty elements become empty strings, and the root element's attributes and children become the top-level JSON keys. You can switch between 2 and 4 space indentation and optionally convert numeric and boolean text values to real JSON types so your data arrives ready to use. Everything runs in your browser: your data is never uploaded, and you can copy the JSON or download it as a .json file.
Standards-aware conversion: text and attribute values are decoded following the XML 1.0 rules for entity and character references, while CDATA content stays 100% literal. Comments, processing instructions and whitespace-only text are removed during parsing, and the result is emitted with JSON.stringify, so the output is always valid JSON (RFC 8259). See the XML 1.0 specification and RFC 8259 for the underlying standards.
No. The whole conversion runs in your browser: the XML is tokenized and parsed locally with JavaScript, and .xml files are read with the FileReader API. Nothing is transmitted, there is no account and no backend is involved.
Attributes become JSON keys with an @ prefix (@id, @currency), so they can never collide with child element keys. Repeated sibling elements, for example several product tags, are collected into an array. Keys appear in document order.
Yes. The standard XML entities and numeric character references are decoded in text and in attribute values. CDATA sections stay fully literal and are never decoded. Namespace prefixes such as ns:item or xmlns are preserved as plain names; the tool does not resolve namespaces.
When enabled, the text true or false becomes a real JSON boolean and numeric-looking text such as 249.90, 14 or 1e5 becomes a real number. Values with leading zeros (007) or a bare decimal point (.5) stay strings so no data is corrupted. Attribute values are converted the same way.
Comments and processing instructions such as the XML declaration are removed, and whitespace-only text between elements is ignored, so the JSON contains only your data. The input must contain exactly one root element; its attributes and children become the top-level JSON keys, and the root name is shown in the status line.
Free online utility tools. No signup. No tracking.
Nutzung auf eigene Gefahr. Diese Tools werden kostenlos und ohne Gewährleistung für Richtigkeit, Vollständigkeit, Verfügbarkeit oder Eignung für einen bestimmten Zweck bereitgestellt; Ergebnisse sind keine professionelle Beratung. Die gesetzliche Haftung — insbesondere für Vorsatz, grobe Fahrlässigkeit sowie für Verletzungen von Leben, Körper oder Gesundheit — bleibt unberührt.
Use at your own risk. These tools are provided free of charge without any warranty of accuracy, completeness, availability or fitness for a particular purpose; results are not professional advice. Statutory liability — in particular for intent, gross negligence and injury to life, body or health — remains unaffected.
Uso bajo su propio riesgo. Estas herramientas se ofrecen de forma gratuita y sin garantía de exactitud, integridad, disponibilidad o idoneidad para un fin determinado; los resultados no constituyen asesoramiento profesional. La responsabilidad legal — en particular por dolo, negligencia grave y daños a la vida, el cuerpo o la salud — no se ve afectada.
Utilisation à vos propres risques. Ces outils sont fournis gratuitement, sans garantie d’exactitude, d’exhaustivité, de disponibilité ou d’adaptation à un usage particulier ; les résultats ne constituent pas un conseil professionnel. La responsabilité légale — notamment en cas de dol, de négligence grave et d’atteinte à la vie, au corps ou à la santé — reste inchangée.