JSON to XML Converter
Paste JSON, get well-formed XML as you type
Input JSON
Output XML
What this converter does
Plenty of systems still want XML: SOAP services, payment gateways, older ERPs. If your data is JSON, paste it on the left and the XML appears on the right. Every object becomes an element, every key becomes a child element, and the whole thing is wrapped in a single root element so the result is always one well-formed document.
JSON and XML are not shaped the same, so the converter follows a few fixed rules. An array repeats its key, so "line": [..] turns into several <line> siblings, and an array at the very top is wrapped as <item> children of the root. A key that starts with @ becomes an attribute, and #text becomes the element's text, which mirrors the output of our XML to JSON tool. Keys that are not valid XML names get repaired: "order date" becomes <order_date> and "3ds" becomes <_3ds>.
Because XML has no data types, every number, boolean and string is written as text, and null, {} and [] all leave an empty element. Big integers like an ICCID of 8901240544102066246 keep every digit, where a plain JSON.parse would round the last few. Everything happens in this tab: the page parses and converts locally, and the JSON is never sent anywhere.
How to Use JSON to XML
The page converts as you type, so these steps are mostly about getting the JSON in and the XML out.
Paste, Upload, or Load Sample
Type or paste into the Input JSON editor, or use Upload to pick a .json file from disk. Sample fills in a two-entry subscriber array so you can see how repeated keys come out. Broken JSON shows the parser's error message above the output instead of half a document.
Configure Settings (Optional)
Click the Settings (gear) button to rename the Root Element (default root; invalid names are fixed up the same way keys are) and to turn the XML Declaration line on or off. The Output XML panel updates as you type.
Download or Copy
Download saves the result as converted.xml; Copy places it on the clipboard and confirms with a short message. For an independent check, paste it into the XML Validator.
When you'd actually use this
API Integration
Feeding a SOAP or XML-only API from a service that speaks JSON. Convert a sample payload, compare it with what the API expects, then adjust key names until they match.
Data Migration
Moving records from a JSON export into a system that imports XML, such as an older ERP or a document store with an XML loader. Convert one file here to check the element layout before scripting the rest.
Format Compatibility
XSLT stylesheets, XPath queries and some reporting tools only work on XML. Converting a JSON response first lets you use them on data that never came in XML form.
Enterprise Integration
Many enterprise systems use XML. Convert JSON to XML when integrating with legacy systems, SOAP services, or enterprise applications.
Common Questions
Is my JSON uploaded?
No. Parsing and conversion happen in your browser. Inputs over 2 MB are refused to keep the page responsive.
How do I get XML attributes?
Give the key an @ prefix. For example {"quota": {"@unit": "GB", "#text": 45.2}} produces <quota unit="GB">45.2</quota>. A nested @attributes object is accepted as well, matching what our XML to JSON converter emits, so a round trip keeps attributes as attributes.
How are arrays handled?
An array becomes one element per entry, all with the key's name. A top-level array is wrapped in the root element with each entry as <item>, because an XML document can only have one root. An array inside an array is also wrapped in <item> elements.
Are data types preserved?
Only as text. XML has no number or boolean type, so 45.2, true and "45.2" all come out the same. null, {} and [] become empty elements. If you need the types back on the other side, describe them with an XML Schema.
What happens to keys that are not valid XML names?
Characters XML does not allow in names (spaces, colons, symbols) are replaced with _, and a name that starts with a digit or punctuation gets a leading _. So "first name" becomes <first_name> and "2fa" becomes <_2fa>.
What about special characters in values?
&, < and > are escaped in text, and quotes are escaped inside attributes. Control characters that XML 1.0 forbids entirely are replaced with the U+FFFD replacement character.
Other JSON Tools You Might Need
If the XML is headed somewhere strict, or you want to go back to JSON later, these are the pages to keep open: