RealJSON
Try now

JSON to XML Converter

Convert JSON to clean, well-formed XML — attributes, arrays and escaping handled for you.

Root element

Array item name

Indent

JSON input

XML output

 

In short: A JSON to XML converter maps JSON objects to nested XML elements and arrays to repeated elements. RealJSON produces well-formed XML with escaped characters, valid element names and optional attributes — all in your browser.

Convert JSON to XML

Legacy systems, SOAP services and many enterprise integrations still expect XML. Paste the JSON your API returns and get an XML document you can send or inspect.

The mapping follows the same conventions as the XML to JSON converter (@attr and #text), so you can convert in both directions and get the same structure back.

How the Mapping Works

Objects and scalars

Each key becomes an element. Strings, numbers and booleans become text; null becomes an empty element.

Arrays

Arrays repeat the parent key: {"tag":["a","b"]} → <tag>a</tag><tag>b</tag>. Top-level arrays use the "array item name".

Attributes and text

Keys starting with @ become attributes; #text sets mixed text content.

Safe output

& < > " ' are escaped and illegal name characters are replaced, so the result always parses.

Frequently Asked Questions

How do I convert JSON to XML?

Paste your JSON, choose a root element name, and the XML is produced instantly. Objects become nested elements, arrays repeat the element, and special characters are escaped.

How are arrays converted?

An array under a key repeats that key as a sibling element — {"tag":["a","b"]} becomes <tag>a</tag><tag>b</tag>. A top-level array is wrapped in the root element using the array item name.

Can I create XML attributes?

Yes. Keys that start with @ (for example "@id") become attributes, and a "#text" key sets the element text — the same convention the XML to JSON tool uses, so conversions round-trip.

What happens to keys that are not valid XML names?

Invalid characters are replaced with underscores and names that start with a digit get a leading underscore, so the output is always well-formed.

Is my JSON uploaded?

No — conversion runs locally in your browser.

Related Tools

XML to JSON · JSON to YAML · JSON to CSV · JSON Formatter

Browse all free JSON tools →

Related tools