Home › Converters › XML to JSON Converter
XML to JSON Converter
Convert an XML document into JSON. Element attributes are preserved under an @attributes key, repeated elements become arrays, and text content stays as a string value.
How to use the XML to JSON Converter
- Paste your XML into the input box.
- Choose an output indent (or Compact).
- Press Convert.
- Copy or download the JSON.
About this tool
XML and JSON model data differently, so every converter makes choices. Ours are explicit: attributes live under "@attributes" so they are never confused with child elements; an element that appears once becomes a single value, while repeated elements become an array; an element with only text becomes that text; and mixed content keeps its text under "#text". Element text is returned as a string, because XML itself has no number or boolean types.