Convertisseur JSON en XML
Guide
Convertisseur JSON en XML
Convert JSON data to well-formed XML instantly. Paste any JSON object or array and get structured XML output with configurable root element names, array handling, indentation, and XML declaration. Handles nested objects, arrays, all JSON types, and special character escaping.
Comment utiliser
Paste your JSON data into the input area. Configure the root element name, array item element name, and output options. The XML output updates instantly as you type or change settings. Copy the result with one click or download it as a file. Use the XML declaration option for standalone XML documents.
Caractéristiques
- Configurable Root Element – Set a custom root element name for the XML output, defaulting to “root” for flexibility.
- Array Handling – JSON arrays become repeated XML elements using a configurable item element name.
- XML Declaration – Optionally include the standard XML declaration header for standalone documents.
- Null Handling Options – Choose how to represent JSON null values: as empty self-closing elements, omitted entirely, or with xsi:nil attributes.
- Special Character Escaping – Automatically escapes &, <, >, and quotes in text content and attribute values for valid XML output.
- Pretty-Print Output – Configurable indentation with 2 spaces, 4 spaces, tabs, or minified output.
- Conversion en temps réel – La sortie se met à jour instantanément lorsque vous collez des données ou modifiez une option.
Quand utiliser cet outil
Use this tool when integrating with XML-based APIs or SOAP services that require XML input, converting JSON API responses for legacy systems, generating XML configuration files from JSON data, or preparing data for XML-based formats like RSS, SVG, or XHTML. It’s essential for developers bridging modern JSON-first applications with enterprise XML infrastructure.
FAQ
-
How does JSON map to XML?
JSON objects become XML elements with child elements for each property. JSON arrays become repeated sibling elements. Strings, numbers, and booleans become text content within elements. For example, {"name": "Alice", "age": 30} becomes Alice30. Nested objects create nested elements, maintaining the hierarchical structure.
-
How are JSON arrays converted to XML?
JSON arrays don't have a direct XML equivalent since XML uses named elements rather than indexed positions. This converter wraps each array item in an element (defaulting to 'item' or a custom name you specify). So [1, 2, 3] becomes 123. Arrays of objects work the same way — each object becomes a child element containing its properties.
-
What is the XML declaration and when should I include it?
The XML declaration () is the first line of an XML document that specifies the XML version and character encoding. Include it when creating standalone XML files, when the encoding matters (especially for non-ASCII characters), or when the receiving system expects a complete XML document. You can omit it when generating XML fragments or when embedding XML within other documents.
-
What happens to JSON keys that are invalid XML element names?
XML element names must start with a letter or underscore and cannot contain spaces or most special characters. When a JSON key would create an invalid XML element name (like keys starting with numbers or containing spaces), the converter sanitizes the name — typically by prefixing with an underscore or replacing invalid characters. This ensures the output is always well-formed XML.
Installez nos extensions
Ajoutez des outils IO à votre navigateur préféré pour un accès instantané et une recherche plus rapide
恵 Le Tableau de Bord Est Arrivé !
Tableau de Bord est une façon amusante de suivre vos jeux, toutes les données sont stockées dans votre navigateur. D'autres fonctionnalités arrivent bientôt !
Outils essentiels
Tout voir Nouveautés
Tout voirMise à jour: Notre dernier outil a été ajouté le 27 mars 2026
