XML JSON
Free online converter

Convert XML to JSON

Convert now
XML to JSON converterFREE
Drop a .XML file here
or pick one - we convert it to .JSON and give you the file to download

On this page

Tested on macOS, Windows & Linux
Last verified Oct 2026

More free converters

HEIC, PNG, WEBP, MP3 and more - every tool here is free.

Open the toolbox

How to convert XML to JSON

  1. Add your .XML file - drop it in the box above or click to browse.
  2. Convert it to .JSON in a few seconds.
  3. Download your new .JSON file.

What to expect

  • XML attributes become JSON keys prefixed with @ (e.g., @id) and element text content becomes #text - rename these if the receiving system expects plain key names.
  • A single XML element converts to an object, not a one-element array; repeated siblings of the same tag become an array. Inconsistent XML (sometimes one item, sometimes many) can break downstream code.
  • XML comments and processing instructions are silently dropped - extract any meaningful metadata manually before converting.

Frequently asked questions

Is the conversion lossless?
Data values survive intact, but structure is not 1:1. Attributes, namespaces, and comments are either renamed or dropped, so complex XML may need a short post-processing step.
Can I convert back from JSON to XML?
Yes, the same tools work in reverse. Because JSON can express things XML cannot (bare arrays, null values), round-tripping may not reproduce the original XML exactly.
Why does the output contain keys like `@id` and `#text`?
Those are the standard conventions for representing XML attributes and element text content respectively - they are not errors. Rename them in a post-processing step if your target system expects plain key names.
What happens to XML namespaces?
Namespace prefixes land in the key names (e.g., ns:price). Strip or map them after conversion if the consuming system does not handle prefixed keys.
Learn about the formats: .XML · .JSON
Programs that convert XML: Navicat Premium · PlistEdit Pro