ConvertAnyFiles

XML to JSON Converter

Turn XML into easy-to-use JSON for JavaScript, REST APIs, NoSQL databases and config files, with attributes, repeated elements and text mapped predictably.

Free · No sign-up · Files stay on your device

How to use XML to JSON

  1. 1Paste your XML.
  2. 2The JSON appears instantly.
  3. 3Copy or download it.

Features

  • Attributes ↔ "@" keys
  • Repeated elements ↔ arrays
  • Pretty-printed output
  • Clear error messages
  • Runs locally in your browser

How the mapping works

Elements become object keys and their text becomes the value. Attributes are written as keys starting with "@" (for example "@id"), mixed text as "#text", and repeated elements with the same name become arrays. This common convention converts back and forth without losing information.

Frequently asked questions

What root element is used for JSON to XML?

If your JSON has one top-level key, that key becomes the root element; otherwise everything is wrapped in <root>.

Are numbers kept as numbers?

XML has no number type. XML to JSON keeps values as text unless you tick "Detect numbers and booleans".

Is my data uploaded?

No. Conversion happens in your browser.

Related tools