JSON to XML
Emit an XML document from a JSON structure.
Loading tool…
About this tool
Converts JSON into XML, mapping object keys to elements and prefixed keys to attributes. The two formats do not correspond cleanly, so the result is a reasonable interpretation rather than a canonical one.
Limitations
- The mapping is ambiguous in both directions. XML distinguishes attributes, elements and text; JSON does not.
- Keys that are not valid XML names are sanitised, which is lossy.
Questions
- Why is the conversion described as lossy?
- XML cannot distinguish a one-element array from a single value, so converting back will not necessarily reproduce the original structure.
Privacy
This page does its work in your browser. What you paste is processed by JavaScript running on your own device and is never sent to a DevToolery server — there is no server that could receive it. The page itself is a static file delivered by a CDN. See exactly what is stored.