JSON to XML
Convert JSON into XML, with sensible element names and nesting.
Your data never leaves your browser
This tool runs entirely on your computer. What you paste or drop is never uploaded, never stored and never seen by us — close the tab and it's gone. How we know
Sign up to run — no credit card required.
Press Run to see the output. Sign up takes ten seconds — no credit card required.
Worked example
{"a":{"b":"1"}}<a>
<b>1</b>
</a>This example is one of JSON to XML's test cases — if the tool stopped producing this output, the build would fail.
Questions
- Why does it insist on a single root element?
- XML has no concept of a top-level array or scalar — a document has exactly one root. If your JSON is an array, wrap it: {"items": [...]}. The tool says so rather than inventing a root name for you.
- How are attributes handled?
- Keys prefixed with @_ become attributes, and #text becomes the element's text content. That's the same convention the XML-to-JSON tool emits, so the pair round-trips.
Related tools
XML Formattertakes xml
Pretty-print and indent XML, however badly it arrived.
XML Validatortakes xml
Check whether XML is well-formed and see exactly where it breaks.
XML to JSONtakes xml
Convert XML into JSON, attributes and text nodes included.
XML Difftakes xml
Compare two XML documents element by element.