XML to JSON Converter
Donfig converts XML documents to JSON in the browser. Element names become object keys; nested elements become nested objects; repeated sibling elements with the same name become arrays. XML attributes are preserved under the conventional _attributes key, and text content under _text — so you can round-trip back to XML without losing information. Useful for ingesting legacy SOAP responses, configuration formats, or sitemap files into modern JSON-based pipelines.
JavaScript is required to use the live tool. Please enable JavaScript and reload.
Frequently asked
How are attributes represented?
Each element with attributes gets an _attributes object alongside its child elements. So <user id="1"><name>A</name></user> becomes {user: {_attributes: {id: "1"}, name: {_text: "A"}}}.
What about XML namespaces?
Namespace prefixes are kept as part of the key name. Namespace URIs are surfaced as attributes (xmlns:foo).
Are CDATA sections preserved?
Yes, under a _cdata key on the element.