JSON ⇄ XML

Convert between JSON and XML formats

100 % gratuit. Fonctionne entièrement dans votre navigateur : vos fichiers et données ne quittent jamais votre appareil et rien n'est envoyé à un serveur.

JSON Input

Drop a JSON or XML file, click to browse, or paste

JSON, XML · up to 5 MB · never uploaded

XML Output

À propos de cet outil

JSON and XML both describe nested data, but they are not equivalent, and the differences are what make conversion interesting. XML elements can carry attributes; JSON objects cannot. XML has no arrays - repetition is just the same tag appearing twice - while JSON distinguishes a one-item array from a bare value. XML has no types at all, so every value arrives as text. This converter handles the common case well: it turns JSON objects into nested elements, escapes characters that would break the markup, and collapses repeated XML tags back into JSON arrays. Where it is deliberately simple is attributes - converting XML to JSON reads element content and ignores attributes, so if your source keeps real data in attributes rather than child elements, you will need to move it first. That covers most API payloads and config files; it does not cover attribute-heavy document XML. Everything is converted in your browser.

Flux de travail

Nettoyer et valider des données d'API

  1. 1Formater le JSONRendez-le lisible et repérez les erreurs de syntaxe.Ouvrir
  2. 2Convertir si nécessairePassez entre JSON, XML, YAML ou CSV.Vous êtes ici
  3. 3Comparer les versionsVoyez exactement ce qui a changé.Ouvrir
  4. 4Tester la requêteEnvoyez-la et inspectez la réponse.Ouvrir

Comment utiliser cet outil

  1. Pick a directionJSON to XML, or XML to JSON. The swap button feeds the output back as input to check a round trip.
  2. Paste your dataBoth sides validate as you convert - malformed input reports a parse error rather than producing wrong output.
  3. Review the structure, not just the syntaxCheck arrays and any attributes specifically, since these are where the two formats genuinely disagree.
  4. Copy the resultFix up types and attributes by hand if the target system needs them.

Pourquoi l’utiliser

  • Handles the awkward parts: XML escaping, repeated tags becoming arrays, and nested objects becoming nested elements.
  • Reports parse errors instead of silently emitting broken output.
  • Swap converts in the opposite direction so you can inspect a round trip immediately.
  • Runs entirely in your browser - useful because API payloads usually contain real customer data.
  • No upload, no account, no size limit beyond your own memory.

Usages courants

  • Feeding a legacy SOAP or enterprise XML response into a modern JSON codebase.
  • Converting a JSON fixture into XML to test an older integration.
  • Turning an RSS or sitemap fragment into JSON to inspect it.
  • Reformatting config between an XML-based tool and a JSON-based one.
  • Making an XML payload readable by viewing it as JSON.

Conseils pour de meilleurs résultats

  • If your XML keeps data in attributes, rewrite them as child elements before converting - attributes are not read.
  • Remember every value from XML comes back as a string. "42" and "true" will need converting to number and boolean yourself.
  • A JSON array with exactly one item does not survive the round trip: it becomes a single element, which reads back as an object rather than an array. Handle that in code if it matters.
  • JSON keys containing spaces, dots or other characters illegal in XML tag names are replaced with underscores, since the alternative would be invalid XML.
  • Convert a small representative sample first and check the shape before running your whole dataset through.

Erreurs à éviter

  • Expecting XML attributes to appear in the JSON output - only element content is read, so attribute data is dropped.
  • Assuming types survive. XML has no type system, so numbers and booleans return as strings.
  • Relying on an exact round trip for single-item arrays, which XML cannot represent distinctly.
  • Sending confidential payloads through a server-based converter when this one does not need to - check where any online converter runs before pasting production data.
  • Ignoring namespaces: prefixed tag names come through as part of the key, so a namespaced document needs review rather than blind conversion.

Questions fréquentes

No. XML to JSON reads element content only, so attributes are not included in the output. If your data lives in attributes, restructure them as child elements first. This keeps the output predictable for API payloads and config files, where nested elements are the norm.

For nested objects and multi-item arrays, yes in structure. Two things change: all values come back as strings because XML is untyped, and an array with a single item comes back as an object, because a lone repeated tag is indistinguishable from a plain child element.

Prefixed tag names such as soap:Body come through with the prefix as part of the JSON key. The xmlns declarations themselves are attributes, so they are not carried over - a heavily namespaced document will convert, but review the result rather than trusting it blindly.

Characters that XML does not allow in a tag name - spaces, dots, slashes - are replaced with underscores, because emitting them literally would produce XML that no parser can read.

No. Conversion happens in your browser using its built-in XML parser, so payloads containing customer records never leave your device.

Usually an unclosed tag, a stray ampersand that should be &, or more than one root element - XML permits exactly one. The error message comes from the browser's own parser, which is strict by design.

Yes. JSON XML is free for normal use with no account required, and ToolBox does not add a watermark to your result.

Most tools in this category run in your browser so the file stays on your device. If a tool needs a temporary server job, files are handled for that job only and are not kept as a lasting archive.

Les gens recherchent aussi

  • json to xml converter online
  • xml to json free
  • convert soap response to json
  • json xml converter no upload
  • xml attributes to json
  • rss to json converter
  • xml to json string values

Related guides