Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

XML to JSON Converter

Turn XML — API responses, RSS feeds, SOAP messages, sitemaps or config files — into clean JSON you can use in JavaScript, Python or any REST API.

Mis à jour le
Open file
Output

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : XML to JSON

  1. Paste XML or open an .xml file.
  2. Choose how attributes, types and empty elements are handled.
  3. List element names that should always be arrays, even when they appear once.
  4. Copy or download the JSON.

How XML maps to JSON

XMLJSON
<name>Ada</name>"name": "Ada"
<price currency="USD">9.5</price>"price": {"@currency": "USD", "#text": 9.5}
Repeated <tag> elements"tag": ["a", "b"]
<![CDATA[ … ]]>Plain string
<empty/>"" or null

The array problem

XML has no arrays, only repeated elements. A converter cannot know that <item> is a list when it appears only once, so the JSON shape changes with the data: one item gives an object, two give an array. That breaks code that expects a list. List such element names under Always arrays for to get consistent output.

Types

All XML content is text. With Detect numbers & booleans, values like 42, 9.5 and true become JSON numbers and booleans. Long numbers (more than 15 digits) and values with leading zeros stay strings to avoid precision loss.

Validation

The XML is parsed with your browser’s XML parser, so malformed input — an unclosed tag or unescaped & — is reported instead of producing broken JSON. Namespaced names (g:price) keep their prefix. Explore the result with the JSON viewer, or convert back with JSON to XML.

Aussi recherché comme : convert xml to json, xml2json, xml json converter, xml to json online, soap to json, rss to json.

Outils complémentaires : XML to JSON

  • XML Formatter — Turn minified or messy XML into clean, indented markup and check that it is well-formed — for feeds, sitemaps, SOAP messages, configs and SVG.
  • Formateur JSON — Collez votre code JSON pour le formater, le compresser ou le valider.
  • YAML to JSON — Paste YAML — a Compose file, Kubernetes manifest or CI config — and get formatted JSON.
  • JSON Schema Validator — Paste a schema and some JSON to see exactly which values break which rule — or generate a starting schema from example data.

Questions fréquentes

Why is a single element an object but several are an array?
XML has no array type. Add the element name to “Always arrays for” to force a list even when it appears once.
What happens to attributes?
They become keys with an @ prefix (configurable) on the element’s object. Tick “Ignore attributes” to drop them.
Are namespaces supported?
Yes. Prefixed names such as atom:link are kept as keys; namespace declarations appear as @xmlns attributes.
Is my XML uploaded?
No. It is parsed in your browser.
Puis-je installer XML to JSON en tant qu’application web et l’utiliser hors ligne ?
Oui. XML to JSON est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires