JSON to XML
Convert JSON data to XML document format.
Convert JSON to XML. Object keys become elements, arrays become repeated elements, and keys starting with @ become attributes, so {"user":{"@id":1,"name":"Ada"}} becomes <user id="1"><name>Ada</name></user>. If the JSON has more than one top-level key or is an array, it's wrapped in a root element you can name. Choose the indent and copy or download the XML.
Common use cases
- Send JSON data to a system or API that only accepts XML
- Make XML test data or fixtures
- Convert config data between formats
How to use
- Paste the JSON.
- Set the root element name and indent.
- Copy or download the XML.
FAQ
How do I make an attribute?
Start the key with @: {"@id": 5} becomes id="5" on the parent element.
What happens to keys that aren't valid XML names?
XML element names can't start with a digit or contain spaces, so rename such keys first.
Related tools
- XML to JSONConvert XML documents to JSON format.
- JSON to CSVConvert JSON arrays to CSV spreadsheet format.
- JSON to YAMLConvert JSON data to YAML configuration format.
- CSV to JSONConvert CSV data to JSON format for APIs and applications.
- YAML to JSONConvert YAML configuration files to JSON format.
- CSV Diff CheckerCompare two CSV files and highlight differences.