Skip to content
empinet.dev
XML

JSON to XML

Convert a JSON object into valid, formatted XML using a predictable mapping for attributes and text.

Conversion workspace

Convert a single-root JSON object into formatted XML.

JSON input
XML output

Use @_name for attributes and #text for text content. Your data stays on this device.

A clear JSON mapping

Use one top-level key as the XML root. Keys beginning with @_ become attributes, #text becomes text content, and arrays create repeated elements.

Valid XML output

The generated document is validated before it is shown. Invalid JSON or a shape that cannot produce one XML root returns a readable error.

JSON to XML FAQ

Why is one root key required?

An XML document must have one root element. The top-level JSON key supplies that element name.

How are arrays converted?

Each array item becomes another XML element with the array property's name.