JSON to XML
Convert JSON data into XML for systems and integrations that use XML-based data exchange.
Your result will appear here.
JSON to XML online
Convert JSON into XML — object keys become elements under a <root> wrapper, arrays become repeated elements — for feeds, legacy integrations and systems that still expect angle brackets.
How to use this tool
- Paste your JSON into the input box.
- Click Run Tool. Objects nest as child elements, arrays repeat their element once per item, and text values are XML-escaped.
- Copy the XML from the result panel.
Common uses
Feeding JSON data into SOAP-era and enterprise systems, generating simple XML sitemaps or product feeds from a JSON source, testing how a payload maps to an XML schema, and producing example documents while designing an integration.
How it works
The mapping is deliberately mechanical: the whole document is wrapped in a <root> element, each object key becomes a child element of the same name, and an array becomes that element repeated once per item. Scalar values are written as text content with &, < and > escaped; null becomes an empty element. There are no attributes and no XML declaration in the output — anything attribute-shaped in your design must be remodelled as child elements.
Worked example
Paste:
{ "user": { "name": "Ana", "tags": ["a", "b"] } }and the result is:
<root><user><name>Ana</name><tags>a</tags><tags>b</tags></user></root>
The array did not get a wrapper element — tags simply appears twice, which is the convention most XML consumers expect.
Privacy and browser processing
Your JSON is converted in your browser with JavaScript — it is never uploaded or stored.
Frequently asked questions
Why is there a element I did not ask for?
XML requires exactly one document element. Since JSON can start with any shape, the converter wraps everything in
How do I produce XML attributes?
You cannot from this converter — it maps keys to elements only, because JSON has no attribute concept. If a target schema needs attributes, transform the element output with your XML tooling afterwards.
My key has a space in it. Is the output still valid XML?
No — keys are used verbatim as element names, and names with spaces or a leading digit are not legal XML. Rename such keys (for example to snake_case) before converting.
Where is the declaration?
The output is an XML fragment without a prolog. Most parsers accept it as-is; add the declaration line yourself if a strict consumer requires one.
Is my JSON uploaded?
No. The conversion runs in your browser; nothing leaves the page.