Data converter

XML to JSON converter

To convert XML to JSON, drop your XML file in the box below. It converts straight away; press Download to save the JSON. It all happens in your browser, so your file stays on your device.

Converted on this device, never uploaded

What changes

XML to JSONWhat happens
RootThe root element becomes the one key of the JSON
AttributesKeys starting with @, like "@id"
Repeated elementsGathered into a list
Text next to elementsUnder "#text"
SafetyDOCTYPE entity declarations are refused (they can expand to gigabytes)

How to convert XML to JSON

  1. Add your XML. Drop the file in the box, or click to choose it. It becomes JSON straight away.
  2. Check the result. Look at the preview. The delimiter and value types are set for you; change them if needed.
  3. Download. Press Download to save the JSON.
Why JSON

Turn an XML feed or export into JSON that is easier to use in JavaScript and most APIs.

Questions

As keys with an @ in front: <book id="b1"> becomes {"book": {"@id": "b1"}}.

An element that appears once is a value; one that repeats becomes a list. That is the usual XML-to-JSON mapping.

Yes, text that is a plain number or true/false becomes a JSON number or boolean. Turn that off to keep everything as text.

No. The conversion happens right in your browser, so your file stays on your device. There is no account to make, either.

Related conversions