Code tool

JSON to XML Converter

Turn JSON data into XML in your browser while keeping the root element, array item names, empty values, and XML escaping explicit.

In-browser processingNo account requiredPrivacy details ↗

Enter any valid JSON value. Maximum 100,000 characters.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste valid JSON and choose the root element name and array item name.
  2. Convert the value and review normalized XML element names and escaped text.
  3. Copy the XML or download it as an XML file.

Predictable JSON-to-XML mapping

Objects become child elements. Arrays become a parent element with repeated item elements. Primitive values become text, while null and empty strings become self-closing elements. The root is always wrapped in the chosen root element.

Safe XML names and text

Element names are trimmed, invalid characters become underscores, and names beginning with a digit or hyphen receive a leading underscore. Ampersands, angle brackets, quotes, and apostrophes are escaped in text. Processing instructions, attributes, and external entities are never generated.

GOOD TO KNOW

Common questions

Can a JSON array be the root?

Yes. The selected root element contains one repeated item element for each array value.

What happens to invalid JSON keys?

Keys are normalized into valid XML element names. Distinct keys that normalize to the same name receive a numbered suffix.

Does conversion upload my JSON?

No. Parsing, conversion, copying, and download preparation happen locally in your browser.