XML to JSON

Convert XML documents into structured JSON.

Paste XML to get a JSON representation. Attributes become @-prefixed keys, text nodes use #text; repeated elements become arrays.

Conversion is local. Numbers and booleans stay strings.

Recommended tools

FAQ

Attributes are converted to JSON keys prefixed with @, for example @id. Repeated elements become JSON arrays.

The names of tags and attributes are taken from the DOM, including the namespace prefixes used. Comments do not end up in JSON, and grouping child elements by name may not preserve the original sequence of tags of different types.