Convert XML to JSON

Convert XML files to JSON. Runs entirely in your browser — files never leave your device.

Drop your file here, or browse

Supports images, documents, data files, code, and more

About this conversion

Convert XML to JSON to modernise legacy data exchange. XML is the older standard — verbose, namespaced, schema-heavy — while JSON dominates new APIs because it's more concise and maps cleanly to JavaScript. The conversion preserves structure while shrinking the payload.

When this conversion is useful

  • Migrating from a SOAP-era XML API to a REST/JSON-friendly client
  • Importing XML config files into JSON-based modern tooling
  • Consuming an XML feed in a JavaScript or Python app that prefers JSON
  • Converting XML data exports for use in JSON-native databases

Quality and tradeoffs

Element names become JSON keys, text content becomes string values, and attributes are typically prefixed (`@`) or merged. Mixed content, CDATA, and namespaces don't have direct JSON equivalents and may need post-processing depending on the source.

Frequently asked questions

How are XML attributes represented in JSON?

Attributes are commonly prefixed with `@` to distinguish them from child elements (e.g., `<item id="1">` becomes `{ "@id": "1" }`). Some converters merge attributes into the element's object directly.

What happens to XML namespaces?

Namespace prefixes are preserved in the key names (e.g., `ns:item`). For programmatic use, you may want to strip them — but doing so before conversion preserves clearer semantics.

Why is the JSON output sometimes nested oddly?

XML is semantically richer than JSON in some ways (mixed content, ordered elements). The converter has to make tradeoffs — repeating elements become arrays, single occurrences become single objects.