JSON to XML Converter

From JSON to XML with valid element names, attributes and clean indentation.

Reverse: XML to JSON

Files never leave your device — everything runs in your browser

JSON to XML is what you need when the data goes to an older system: an accounting package, a bank, a government portal or a SOAP service. Objects become elements, arrays become repeated elements, and keys that start with @ become attributes. So {"product": {"@sku": "A-101", "price": 29.9}} turns into <product sku="A-101"><price>29.9</price></product>.

The root element and the element name for a top-level array are set in the options — root and item by default. Keys that are not valid XML names, with spaces or a leading digit, are repaired carefully: first name becomes first_name. Letters from any alphabet are allowed by the XML standard and stay as they are.

Special characters &, < and > are escaped, long integers are written in full, and the <?xml version="1.0" encoding="UTF-8"?> line is added if you want it. Indent with 2 or 4 spaces, or put everything on one line.

Nothing is uploaded: parsing and conversion run inside your browser, so API responses, CRM exports and files with personal data stay on your device.

Options and features

How to convert JSON to XML in 3 steps

  1. 1

    Load the JSON

    A file, pasted text or the Sample. Syntax errors are shown with a fix offered.

  2. 2

    Set up the XML

    Root element, array item name, attribute prefix, indent and declaration.

  3. 3

    Download the XML

    Or copy the result from the preview.

Frequently asked questions

Load the JSON and the XML appears at once. Change the root or attribute options and it is rebuilt.
Prefix the key with @, for example "@id": 5 — it becomes the attribute id="5".
Each item becomes its own element named after the key. A top-level array is wrapped in root with item elements.
XML to JSON understands attributes, CDATA and repeated elements.

Related tools