JSON to XML
Convert JSON to XML as you paste: pick the root tag, how arrays are written, @ keys as attributes, indentation and XML declaration. Invalid names are fixed.
How to convert JSON to XML
- Paste JSON on the left or open a .json file; the XML appears on the right.
- Set the root tag, and pick how arrays are written and the indentation the receiving system expects.
- Copy it or download the .xml file. Open several files at once and download them all as a ZIP.
Frequently asked questions
By default each item becomes an element with the same name, so "tags": ["a", "b"] becomes two tags elements. With "Wrap each item" you get one tags element holding child elements named after the array item name (item by default).
Put @ in front of the key: "@id": 5 becomes the attribute id="5" on the element that contains it. The #text key is the text inside the element. Turn this off if your JSON has keys starting with @ that are not attributes.
XML element names cannot contain spaces or start with a digit, and may only use letters, digits, hyphens, underscores and dots. Keys such as "first name" or "1st" become first_name and _1st, and every change is listed under the result.
If the JSON has a single top-level key, such as "catalog", that key becomes the root element. Otherwise the root is root.
No. The ampersand, less-than and greater-than signs and quotes are escaped the way XML expects, and numbers stay exactly as in the JSON, even very long ones.
It is completely free and needs no sign-up.
Related tools
JSON to YAMLConvert between JSON and YAMLJSON to CSVConvert between JSON and CSV tablesJSON FormatterFormat, minify and validate JSONJSON to TypeScriptGenerate TypeScript interfaces from sample JSONJSON to JSON SchemaGenerate a JSON Schema from a JSON sampleJSON Schema validatorCheck whether JSON data matches a JSON SchemaJSON to ZodGenerate a Zod schema from a JSON sampleJSON to Go structGenerate Go structs from a JSON sampleJSON to Python dataclassGenerate dataclasses or Pydantic models from JSON