🔄

XML to JSON

Convert XML documents into JSON data

🔄 ConvertersFreeRuns in your browser

Repeated sibling elements become arrays. Element text is stored as #text when the element also has children or attributes.

About the XML to JSON

The XML to JSON converter turns a feed or API response into JSON you can use in JavaScript. Attributes become properties, and repeated sibling elements collapse into arrays.

Feeds, SOAP responses, and configuration exports are still commonly XML. Converting to JSON once makes the data easier to inspect in the browser and to shape for a frontend.

  • ✓Attributes mapped to properties
  • ✓Repeated elements become arrays
  • ✓Parser errors reported clearly

How to use the XML to JSON

  1. 1

    Paste well-formed XML.

  2. 2

    Choose whether attributes get an @ prefix.

  3. 3

    Copy the JSON output.

Frequently asked questions

Where does element text go when there are children?+

It is stored under the #text key so it does not collide with child element names.

Is the JSON reversible back to XML?+

Not automatically. The conversion loses details such as namespaces and attribute order, so keep the original XML if you need to round-trip.

Save XML to JSON to your favorites, or keep browsing converters.

Browse all 45 converters →