Developer tools
JSON to XML Converter (and XML to JSON)
Free, no sign-up, works in your browser. Convert JSON to well-formed XML, or XML to JSON, with attributes, repeated elements and text kept intact. Errors point to the line that needs fixing.
Attributes appear as keys starting with @, repeated elements become lists, and text next to child elements goes in #text. The same keys work in the other direction.
Your data stays on your device.
How to use the JSON to XML Converter
- Choose JSON to XML or XML to JSON.
- Paste your data or open a file.
- Copy or download the result.
Frequently asked questions
- How are XML attributes shown in JSON?
- As keys starting with @, so <book id="1"> becomes {"book": {"@id": 1}}. Use the same keys in JSON to create attributes in XML.
- What happens to repeated elements?
- Elements with the same name become a JSON list. A JSON list turns back into repeated elements.
- What if a JSON key isn't a valid XML name?
- Characters XML doesn't allow are replaced with underscores, and names that start with a digit get a leading underscore.
- Are comments and CDATA supported?
- CDATA content is kept as text. Comments, the XML declaration and DOCTYPE are skipped, since JSON has no place for them.
- Is my data uploaded?
- No. Conversion happens on your device.
- Is the JSON to XML Converter free?
- Yes. It's free to use, with no sign-up and nothing to install.
Related tools
- JSON FormatterPaste JSON to check that it's valid, then format it with clear indentation or minify it to one line. If something is wrong, you see the line and column of the mistake. Your data stays on your device.
- JSON to CSV ConverterConvert a JSON array into a CSV file you can open in Excel or Google Sheets, or turn CSV back into JSON. Nested objects become columns like user.name, and nothing you paste leaves your device.
- YAML to JSON ConverterConvert YAML to JSON or JSON to YAML as you type, with clear errors when the YAML isn't valid. Anchors, multi-line strings and multiple documents are supported.
- HTML Entity Encoder and DecoderEncode text into HTML entities so it shows safely on a web page, or decode entities like &, é and é back into readable text.