Skip to content
Categories
JSON to XML
Convert JSON to XML format.
Overview
- Converts JSON-formatted data into XML format.
- Automatically adds a root element, which JSON does not have, and outputs formatted XML with an XML declaration.
- Useful when XML is required for data exchange, such as with legacy systems or SOAP APIs.
Usage
- Enter the JSON you want to convert into the text area.
- Click the "Convert to XML" button.
- The formatted XML is displayed below. Use the "Copy" button to copy it to the clipboard.
Example
Input
{"name":"Taro","age":20}Output
<?xml version="1.0" encoding="UTF-8"?> <root> <name>Taro</name> <age>20</age> </root>
Use Cases
- Converting a JSON response fetched from a REST API before passing it to a system that requires XML
- Converting test data authored in JSON into XML format for a test environment that requires it
- Converting JSON configuration data as a starting point for migrating it to an XML configuration file
FAQ
Is the JSON I enter sent anywhere?
No. All conversion happens entirely in your browser and is never sent to an external server.
How are arrays converted to XML?
Each element of an array is output as a sibling element sharing the same name as the parent key.
What happens to a key that contains characters not allowed in an XML element name?
Characters that cannot be used in an XML element name, such as spaces, are replaced with underscores.
Notes
- Each element of an array is output as a sibling element sharing the same name as the parent key (no array-specific tag is generated).
- Key names containing characters that cannot be used in an XML element name, such as spaces, are automatically replaced with underscores.
- A <root> root element is automatically added to the generated XML.
Related Tools
Convert XML into JSON format.
Format XML to make it easier to read.
Convert JSON into YAML format.