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.

XML to JSON Converter

How to use the XML to JSON Converter

  1. Paste your XML into the input box.
  2. Choose an output indent (or Compact).
  3. Press Convert.
  4. 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.