JSON to XML Converter

Turn JSON into XML — objects become nested elements, arrays repeat tags, and @keys become attributes. Pretty-print and download. Runs in your browser; nothing is uploaded.

How to Convert JSON to XML

Three steps, all in your browser.

1

Paste or load your JSON

Paste JSON text into the box, or click “Load .json file” to open an export or API response. The tool converts as you type — no button to press.

2

Pick your options

Name the root element, add an XML declaration, or turn on Pretty-print for indented output. Keys written as @name become attributes and #text becomes element text. Need the reverse? Use the XML to JSON Converter.

3

Copy or download

The XML appears in the output box. Hit Copy XML to send it to your clipboard, or Download .xml to save a file. Nothing is uploaded — it all happens on your device.

Frequently Asked Questions

How do I convert JSON to XML?
Paste your JSON into the input box, or load a .json file. The tool converts it to XML instantly as you type. Each object key becomes an element, nested objects become nested elements, and arrays repeat the same tag once per item. Then click Copy XML or Download .xml. Turn on Pretty-print to get indented, readable output.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser with JavaScript. The JSON you paste or the file you load is parsed on your own device and is never sent to a server, logged, or stored. That means you can safely convert private exports, API responses, or internal data, and the tool keeps working offline once the page has loaded. Closing or refreshing the tab clears everything.
How do attributes and text content work?
The tool mirrors the convention used by the XML to JSON converter: a key written as “@name” becomes an attribute on its element, and a “#text” key becomes the element's text content alongside its attributes. Any other key becomes a child element. This means data produced by the XML to JSON converter round-trips back to equivalent XML.
What is the root element?
XML needs exactly one top-level element. If your JSON is a single object with one key — for example {"note": {…}} — that key is used as the root automatically. Otherwise the tool wraps everything in a <root> element, and you can rename it in the Root element box to anything you like.
Are element names cleaned up?
Yes. XML tag names cannot contain spaces or start with a digit, so any key that would be invalid is made safe — spaces and other illegal characters become underscores, and a leading underscore is added where needed. Text and attribute values are fully escaped, so ampersands and angle brackets never break the markup.