JSON to XML Converter
Runs locallyConvert JSON documents to properly escaped XML with custom root and attributes.
What is JSON to XML Converter?
Transform JSON objects and arrays into valid, properly escaped XML using fast-xml-parser. Customize the root element name, attribute prefix, XML declaration, and indentation.
How to use JSON to XML Converter
- Step 1
Paste JSON into the input panel.
- Step 2
Set root tag name, indentation, and attribute prefix if needed.
- Step 3
Copy or download the resulting .xml file.
Features
- Properly escapes &, <, >, and quotes in XML values
- Supports attribute prefix mapping (e.g. @_id)
- Optional <?xml version="1.0"?> declaration
- Customizable root element wrapper for arrays
- Pretty-print or compact single-line XML output
- Runs completely in your browser
Example
Input
{"user":{"@_id":"42","name":"Ada & Grace"}}Output
<?xml version="1.0" encoding="UTF-8"?> <user id="42"> <name>Ada & Grace</name> </user>
Escapes special XML characters and maps @_ attributes cleanly.
Frequently asked questions
How are XML attributes represented in JSON?
Keys starting with @_ (configurable) are emitted as XML attributes.
Does it escape special characters like & and < ?
Yes, fast-xml-parser encodes XML entities automatically so output is well-formed.
Is data sent to a backend?
No, everything runs locally in your browser.
Can I convert the XML back to JSON?
Yes, click Swap or open the output in XML to JSON.
Related tools
XML to JSON Converter
Parse XML documents into clean JSON with attribute, namespace and array controls.
JSON Formatter & Validator
Format, validate, minify, repair, sort keys and query JSON with Tree and Table views.
JSON to YAML Converter
Convert JSON to YAML and back with indent, flow style, key sorting and lossy warnings.