Skip to content
Devtoolry

XML to JSON

Convert XML to JSON, preserving attributes and repeated elements as arrays.

About the XML to JSON

The XML to JSON converter turns XML documents, feeds and SOAP responses into JSON you can use in JavaScript. Attributes are preserved and repeated elements become arrays.

Conversion happens in your browser, so your files and records stay private.

How to use the XML to JSON

  1. Paste XML or open a file.
  2. Choose the indentation.
  3. Copy or download the JSON.

Frequently asked questions

How are attributes represented?

Attributes become keys starting with @_ (for example @_id), next to the child elements, so no information is lost.

Why is a single child not an array?

Elements that appear once become objects; elements that repeat become arrays. Check the sample to see both.