Anyrow
Log InGet Started

Free online tool

Free Online JSON to XML Converter

Convert JSON to XML online for free. Configurable root element name. Preserves @_ attribute convention for round-tripping from XML-to-JSON output. Pretty-printed with 2-space indent. 100% client-side.

01How it works

01

Paste your JSON

Paste any valid JSON object or array. Set the root element name if the default 'root' is not suitable.

02

Click Convert

The JSON is wrapped in the root element and serialised as pretty-printed XML with 2-space indentation.

03

Copy or download

Copy the XML to clipboard or download it as output.xml.

FAQ

Frequently asked questions

How do I control the root element name?

The root element name defaults to 'root'. You can change it to any valid XML element name before converting. If your JSON represents a list of users, set the root element to 'users' to get <users><item>...</item></users>.

How are JSON arrays converted to XML?

JSON arrays at the top level of any key produce a sequence of sibling XML elements with the same tag name. For example, {"item": ["a"} becomes <root><item>a</item><item>b</item></root>. This is the standard XML convention for representing arrays.

How does the @_ attribute convention work for round-tripping?

If your JSON came from the XML-to-JSON converter on this site, any keys prefixed with @_ are converted back to XML attributes. The @_ prefix convention ensures a clean round-trip: XML attributes survive the JSON detour and return as attributes in the XML output.

What if a JSON key is not a valid XML element name?

XML element names must start with a letter or underscore and cannot contain spaces. If a JSON key is not a valid XML element name (e.g., starts with a digit, contains special characters), fast-xml-parser will attempt to serialise it anyway, but the resulting XML may not be well-formed. Rename problem keys in the JSON before converting.

Other free tools

JSON to CSV ConverterCSV to JSON ConverterJSON Formatter & ValidatorBrowse all tools →

Need AI-powered document extraction?

This tool uses client-side processing. anyrow uses AI to extract structured data from PDFs, images, and scanned documents with 99% accuracy. 150 free extractions/month — no credit card required.

Try anyrow freeSee how it works