XML → JSON / online converter

XML to JSON Converter

Convert XML to JSON for modern code and APIs. Repeating elements become an array of objects, with attributes as @_ fields.

01 / how to

How to convert XML to JSON

01

ADD YOUR XML

Drop the XML file into the box above or choose it from your device.

02

CONVERT TO JSON

JSON is already selected. Press Convert and wait a few seconds.

03

DOWNLOAD

Save the finished JSON file. The original is deleted from our server.

02 / what you get

What happens to your data

Kept

  • The repeating elements (for example every <book>) become the records, and their child tags become fields
  • Attributes are kept as fields named @_attribute, for example @_id
  • Codes with leading zeros, like 007, stay text instead of turning into 7
  • Pretty-printed JSON that any programming language can read
  • Numbers become JSON numbers, and codes like 007 stay text
  • Nested objects and lists keep their structure.

Good to know

  • Only the repeating records are exported. The wrapper elements around them (like <catalog>) are dropped.
  • Text mixed with tags inside one element is read as a #text field.
  • Anything around the records in the source file (wrapper elements, comments, metadata) is not carried over.

03 / formats

XML vs JSON

XML

An XML (Extensible Markup Language) file stores structured data using custom, nested tags, similar to HTML. It's verbose but strict, which makes it reliable for automated systems — common in enterprise software, government forms, and legacy data exports.

Used in: Enterprise systems · Government forms · Legacy data exports

JSON

A JSON (JavaScript Object Notation) file stores structured, nested data as readable text — objects, arrays, and key-value pairs. It's the standard format for web APIs and app configuration, so you'll often get one from a developer, an API response, or an app's settings export.

Used in: Web APIs · App configs · Settings exports

04 / more

More conversions

Have a different file? Open the main converter — it detects the format for you.