JSON to XML Converter
Convert JSON to XML online for free: paste JSON or upload a .json file and get well-formed XML with configurable root and item names, @attribute and #text support, null handling, and exact JSON error positions. 100% in your browser, no signup.
Your XML will appear here.
⚡ This converter turns JSON into well-formed XML: objects become elements, arrays repeat the item element, @keys become attributes, #text becomes element text, and nulls follow the mode you pick. Invalid keys are repaired automatically and listed below, and text is escaped so the output is always valid XML. Everything runs locally in your browser.
🔒 Privacy: conversion runs locally in your browser. Your JSON is never uploaded, stored or seen by anyone else.
More developer tools
How this calculator works
A JSON to XML converter turns the data format most APIs speak into the format most config files, feeds and legacy systems still expect. JSON is compact and easy for code to read, but XML is what sitemaps, RSS feeds, SOAP services, Office documents and many enterprise imports require, and converting by hand means retyping every nested object and array while keeping the tags matched. Paste your JSON here, or upload a .json file, and the well-formed XML appears instantly, with live counts of elements, attributes and nesting depth and a one-click copy or .xml download.
The conversion follows the mapping most XML tools already use, so the output is predictable and easy to read back. Every object becomes an element, every array repeats one element per entry, and numbers and booleans become plain text inside their elements. Keys that start with @ become attributes instead of elements, and a #text key becomes the text content of its element, which is the same convention the XML Formatter on this site uses when it converts XML back to JSON, so data converted here converts back cleanly there. Three options cover the choices that change the shape of the output: the root element name (root by default), the element name used for array entries (item by default), and how null values are handled, as an empty element, omitted entirely, or marked with xsi:nil. The XML declaration and the indentation (2 spaces, 4 spaces or a tab) are toggles too.
Two details keep the output safe to use anywhere. First, every piece of text is escaped, so a value like Tom & Jerry <Tales> becomes Tom & Jerry <Tales> and the document stays well-formed no matter what characters your data contains. Second, keys that are not valid XML names, such as one that starts with a digit or contains spaces, are repaired automatically (2nd place becomes _2nd_place) and the tool tells you exactly which keys it changed, instead of failing or silently dropping them. If your JSON has a mistake, the validator reports the exact line and column, so a missing comma is a one-minute fix instead of a hunt. Your JSON never leaves your device, and the result is ready to paste into a config file, a feed or an API request.
