Convert XML to clean, readable JSON instantly
Conversion rules
@ (e.g. @id).true/false), and null values are automatically coerced.#text key.Need to convert XML to JSON quickly? This free online XML to JSON converter parses any valid XML document in your browser using the native DOMParser API and outputs clean, formatted JSON. Attributes are prefixed with @, repeated sibling tags become arrays, and primitive values like numbers and booleans are automatically coerced — no server uploads, no dependencies, instant results.
Each XML attribute is mapped to a JSON key prefixed with @ — for example, an attribute id="1" becomes "@id": 1 in the output object. This follows a widely-used convention that keeps attributes distinct from child element data.
Repeated sibling elements with the same tag name are automatically grouped into a JSON array. For example, three <book> elements inside <library> will produce a "book" key whose value is an array of three objects.
Yes. The converter automatically coerces values: "true" and "false" become JSON booleans, numeric strings become JSON numbers, and empty strings become null. All other values remain strings.
No. Everything runs entirely in your browser using the built-in DOMParser API. No data is uploaded to any server, making it safe for sensitive or internal XML documents.