JSON to XML
Convert JSON into XML, with sensible element names and nesting.
Runs in your browser — your data never leaves it
Paste, type, or drop a file. Runs as you type.
Output appears here as you type.
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.