XML to JSON & JSON to XML Converter

Legacy SOAP response in one hand, modern JSON API in the other? Convert XML ↔ JSON, format ugly XML, and validate well-formedness — locally.

Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/xml-to-json" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/xml-to-json" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - XML to JSON & JSON to XML Converter</a></div>

XML vs JSON

XML is verbose but strict — it has attributes, namespaces and a formal spec. JSON is compact and native to JavaScript. Most modern systems speak JSON, but legacy enterprise systems (SOAP, RSS, config exports) still emit XML — hence the eternal converter. This tool handles the practical subset: elements, attributes, text, nesting, and CDATA-ish text content.

Conversion rules used here

Formatting & validation

Format pretty-prints any XML with proper indentation using the browser's DOMParser (and reports parse errors with line hints). Validate checks well-formedness — not schema validity (that needs an XSD; no way to do it fully static). For config-family formats see YAML and TOML tools.