No tool matches “”

Try a format (“webp”, “mp3”) or a verb (“merge”, “compress”).

Loading index

↵to open

Developer Tools · Updated November 8, 2026 · Reviewed by FormatFlow Editorial

JSON to XML Converter

You can convert JSON to well-formed XML in your browser, with arrays as repeated elements, @ keys as attributes, a configurable root name and XML special characters escaped correctly.

Runs in your browserFree · No sign-up · No watermark
JSONXMLRuns in your browser
Loading the tool…

Everything runs locally in this tab. No file is uploaded while the tool loads.

This tool runs in your tab. Nothing is uploaded and no copy is stored.

How files are handled

Key facts

Category
Developer Tools
Processing
In your browser — nothing is uploaded
Input formats
JSON
Output format
XML
Maximum size
Bound by the memory available to your browser tab
Requirements
Chrome, Edge, Firefox or Safari · JavaScript enabled
Price
Free, no account, no watermark
Last updated
Nov 8, 2026

SummaryJSON to XML is a free online developer tools tool. You can convert JSON to well-formed XML in your browser, with arrays as repeated elements, @ keys as attributes, a configurable root name and XML special characters escaped correctly. Turning JSON into XML means deciding what attributes, elements and text should be, because JSON has no equivalent distinction. This converter uses the inverse of the mapping its sibling XML to JSON tool uses: object keys starting with @ become attributes, a #text key becomes text content, arrays become repeated elements and plain object keys become child elements. It runs in your browser — nothing is uploaded. It accepts JSON and produces XML. The maximum size is bound by the memory available to your browser tab. JSON has no native attributes or text, so attributes and #text only appear when the JSON uses the documented @ and #text conventions.

At a glance

Formats
JSON → XML
Processing
In your browser
Max size
Device memory bound
Price
Free, no account
Updated
November 8, 2026
All Developer Tools

About JSON to XML

Turning JSON into XML means deciding what attributes, elements and text should be, because JSON has no equivalent distinction. This converter uses the inverse of the mapping its sibling XML to JSON tool uses: object keys starting with @ become attributes, a #text key becomes text content, arrays become repeated elements and plain object keys become child elements.

A root element always wraps the document, because XML requires exactly one root. Its name is configurable and defaults to root; if the JSON has a single top-level key with the same name, that key is treated as the root element instead, which makes the XML to JSON output round-trip cleanly. Element names are sanitised to valid XML names, special characters are escaped and the result is checked by parsing it back with DOMParser before you copy it.

What this tool does

The details that matter when you use JSON to XML for real work.
  • Inverse mapping

    @ keys become attributes, #text becomes text content, arrays become repeated elements and other object keys become child elements.

  • Configurable root element

    Set the root name for any document; a single top-level key that matches the root name is unwrapped so XML to JSON output round-trips.

  • Array to repeated elements

    Every array item is emitted as an element with the same name, which is how XML represents lists, including nested arrays.

  • Escaping handled

    Ampersands, angle brackets and quotes are escaped in text and attribute values, so the result stays well formed without manual editing.

  • Valid XML output

    The generated XML is parsed with DOMParser before it is shown, so malformed names or structure are caught instead of downloaded silently.

  • Copy, download, no upload

    Copy the XML or download it as an .xml file; the JSON is read locally in the browser and never sent to a server.

How to use JSON to XML

No account, no installation — the whole job happens in this browser tab.
  1. 01

    Paste or load JSON

    Paste the JSON into the input pane or load a .json file from your device; files up to 10 MB are accepted.

  2. 02

    Choose the root name

    Set the root element name, root by default. If the JSON has a single top-level key with that name, it becomes the root element itself.

  3. 03

    Convert to XML

    Press Convert. The JSON is parsed, mapped to elements, attributes and text, escaped and then validated as XML.

  4. 04

    Review the XML

    Check the output for expected attributes, repeated elements and escaped characters, and fix any JSON error shown with a line and column.

  5. 05

    Copy or download

    Copy the XML to the clipboard or download it as an .xml file named after the uploaded document.

Supported formats and limits

Input
JSON
Output
XML
Processing
Client-side, in your browser. Nothing is uploaded.
Maximum size
Bound by the memory available to your browser tab.
Requirements
Chrome, Edge, Firefox or Safari · JavaScript enabled

Limitations worth knowing

  • JSON has no native attributes or text, so attributes and #text only appear when the JSON uses the documented @ and #text conventions.
  • Object keys that are not valid XML names are sanitised, so the output name can differ slightly from the JSON key.
  • A single-element array becomes one element and, when read back with the default array mode of XML to JSON, comes back as a scalar.
  • Input is capped at 10 MB of JSON and conversion runs on the main thread after a short yield.

Privacy and file handling

Your JSON is read, parsed and converted entirely inside this browser tab. The payload is never uploaded to FormatFlow or anyone else, no copy is stored and nothing leaves your device; closing the page clears the input and the XML result.

Read the full privacy policy

JSON to XML FAQ

Short, direct answers to the questions people ask before using this tool.
How do I express an attribute in the JSON?
Use a key that starts with the attribute prefix, @ by default. {"item": {"@id": "7", "#text": "value"}} produces <item id="7">value</item>. The prefix can be customised in the options.
How are JSON arrays represented?
Each item becomes an element with the array's key as its name. {"items": [1, 2]} becomes <items>1</items><items>2</items>, and an array at the top level produces item elements inside the root.
What does the #text key do?
#text sets the text content of the current element. It is needed when an object has both attributes or children and text, because a JSON object needs an explicit key for that string.
Why does the root name sometimes get unwrapped?
If the top-level JSON object has exactly one key and that key matches the configured root name, the converter treats it as the root element instead of nesting it. That makes output from the XML to JSON tool round-trip without a duplicated root.
How are invalid XML names handled?
Keys that cannot be XML names are sanitised: characters outside letters, digits, _, -, . and : become underscores, and a leading digit gets a leading underscore. The output notes when names were changed.
Are special characters escaped?
Yes. In text content, & < > are escaped, and in attribute values quotes are escaped as well. That keeps the XML well formed even when the JSON strings contain markup characters.
Why does my JSON fail to convert?
The input must be valid JSON: double-quoted keys and strings, no comments and no trailing commas. The error message includes the line and column where the browser parser stopped.
Is my JSON uploaded anywhere?
No. The file is read with the File API, parsed and converted in this browser tab. Nothing is uploaded, stored or logged, and closing the page discards the input and the XML result.

Background reading

Format guides that explain the trade-offs behind JSON to XML.