JSON to XML Converter
Paste JSON to get well-formed XML. Arrays become repeated elements, and names that XML cannot use are fixed for you.
Use the tool
Loading the tool…
About JSON to XML Converter
Convert JSON into XML. Choose the name of the outer element, decide how keys that start with @ are handled (they become attributes), and choose the indentation. You can also add the XML declaration at the top.
Worked example
Paste a JSON object with a key named `@id` and a key named `name`. With the outer element named `person`, the `@id` key becomes an attribute and `name` becomes a child element.
Limits
JSON and XML do not map one-to-one. Arrays, mixed content and special characters can convert in ways you did not expect, so check the output against your data before using it.
How to use JSON to XML Converter
- Paste the JSON.
- Choose the outer element name and options.
- Copy the XML.
Good to know
- Invalid names are changed and listed in a note.
- null and empty text become empty elements.
- Keys starting with @ can become attributes, and #text becomes the text.
- The input can be up to 1 MB.
Frequently asked questions
How are arrays written?
As repeated elements with the same name. A list inside a list uses item elements.
Why was a key renamed?
XML names cannot contain spaces or start with a digit, so such names are fixed and shown in a note.