🧰Locly

Convert XML to JSON and Back

Convert between XML and JSON locally in your browser

About This Tool

XML ↔ JSON Converter turns XML into JSON and JSON into XML so you can move data between formats. Parsing and conversion are processed locally in your browser.

How to Use

  1. Paste XML or JSON
  2. Choose XML → JSON or JSON → XML
  3. Fix any validation error if shown
  4. Copy the output
  5. Clear when finished

Common Use Cases

  • Convert API XML samples to JSON
  • Prepare config files
  • Debug nested data
  • Teach XML vs JSON structure
  • Quick one-off transforms

FAQ

Q1: Is my data uploaded?

No. Conversion is processed locally in your browser.

Q2: What happens on invalid XML?

A clear error is shown and no output is produced until the input is valid.

Q3: How are repeated tags handled?

Repeated child elements become JSON arrays.

Q4: Are attributes preserved?

Yes. Attributes are stored under @attributes when converting to JSON.

Q5: Can JSON arrays become XML?

Yes. Array items are written as repeated tags with the same name.

Related Tools