ToolNest logoToolNest.

Free JSON to XML Converter

Last updated: October 23, 2026

Quick answer: Legacy systems still speak XML — SOAP APIs, enterprise feeds, healthcare HL7 interfaces, and government data exchanges all expect angle brackets where your modern stack produces curly braces. This free JSON to XML converter bridges the gap: paste any JSON and it returns well-formed XML with a proper declaration, a root element you name, arrays turned into repeated elements, and keys starting with @ turned into attributes. Invalid JSON gets a plain-language error pointing at the problem instead of a blank page. Everything runs in your browser, so API payloads, database schemas, and internal configuration never leave your device.

Conventions: arrays become repeated elements with the same tag; keys starting with @ become attributes of their parent element; a #text key becomes the element's text content; null becomes a self-closing tag; keys that are not valid XML names (starting with a digit, containing spaces) are sanitized with underscores. Your JSON is parsed locally — nothing is uploaded.

✓ Free forever  ·  ✓ No signup  ·  ✓ Tool inputs stay in your browser — never sent to our servers.

How to Use the JSON to XML Converter

  1. Paste your JSON into the input box — or press Load sample to see the conventions on a working example first.
  2. Name your root element. XML requires exactly one root, and JSON does not, so the converter wraps your data in one: 'root' by default, 'catalog', 'response', or whatever your target schema demands.
  3. Pick your indentation (2 spaces, 4 spaces, tab, or none for minified output) and decide whether to include the XML declaration.
  4. Press Convert to XML. If the JSON is invalid, the error message quotes the parser's complaint — a missing comma or an unquoted key — so you fix the input instead of guessing.
  5. Copy the result or Download .xml and paste it straight into your SOAP request, feed file, or schema validator.

Why Use Our JSON to XML Converter?

Common Use Cases

JSON to XML Converter vs Alternatives

Generalist converter farms will convert your JSON, and libraries will convert it inside your code. For a one-off conversion with documented attribute conventions, honest array handling, and zero upload of your payload, this page is the fastest private route from JSON to well-formed XML.

Frequently Asked Questions

How do I convert JSON to XML online for free?
Paste your JSON into the input box above, name the root element your target system expects, and press Convert to XML. The output appears instantly with a declaration, proper indentation, and arrays as repeated elements — then copy it or download the .xml file. No signup, no install, no upload.
How are JSON arrays converted to XML?
Each array item becomes a repeated element with the array key's name. {"tags": ["dev", "writer"]} becomes <tags>dev</tags><tags>writer</tags>. A root-level array has no key, so its items become <item> elements under your root. This is the standard convention, but note it is lossy in one direction: from the XML alone you cannot tell a single repeated element from a one-item array, so keep the JSON if you need a perfect round trip.
How do I make a JSON key an XML attribute?
Prefix the key with @: {"book": {"@isbn": "9780441172719", "title": "Dune"}} converts to <book isbn="9780441172719"><title>Dune</title></book>. For an element that needs both text and attributes, use #text for the content: {"note": {"#text": "Hello", "@lang": "en"}} becomes <note lang="en">Hello</note>.
What happens to null, numbers, and booleans?
Numbers and booleans become text content — 36 becomes <age>36</age>, true becomes <open>true</open> — because XML has no native number or boolean type; the consuming parser decides the type. Null becomes a self-closing tag, <middleName />, which is the honest XML representation of 'present but empty'.
Why is the XML bigger than the JSON?
XML repeats every key as an opening and closing tag, so converted output is typically 1.5–3× the size of the source JSON. That verbosity is the price of XML's self-describing structure and schema validation — it is expected, not a bug, and it is why minified output exists for transmission while indented output exists for humans.
Is my JSON data sent to a server?
No. The conversion runs entirely in JavaScript in your browser, so the data you paste — which may include API keys, database schemas, or internal configuration — never leaves your device. That is also why there is no file-size queue or account: the practical limit is your device's memory.
Can I convert XML back to JSON with this tool?
Not with this tool — it converts JSON to XML only, because the two directions need different conventions (attributes vs keys, repeated elements vs arrays). For the reverse trip, look for a dedicated XML-to-JSON converter and check how it handles attributes, or your round trip will silently change shape.