JSON to XML converter.
The conversion runs entirely in your browser, nothing is uploaded. Going the other way? XML to JSON converter →
Convert JSON to XML faster without the browser
Convert JSON more than once a week? The jsonbolt desktop app removes the copy–find-a-tab–paste loop: a global hotkey opens whatever JSON is on your clipboard, and XML export, formatted or minified, is two clicks away. It works in milliseconds on large files that would kill a browser tab.
Copy JSON anywhere
A terminal, an API client, a log file, a browser tab, if it's on your clipboard, it's ready.
Press Win + J⌃ ⌥ J
jsonbolt launches and opens your clipboard in one step. (Opt-in: Settings → Launch.)
Export as XML
File → Export Selection Value As → Formatted XML writes a file; Copy Selection Value As puts it straight back on the clipboard. Select any subtree to convert just that branch.
YAML, CSV, and XML export are built in.
How JSON maps to XML
| JSON | XML |
|---|---|
| Object key | An element named after the key |
| Array | The element repeated once per item |
| String / number / boolean | Text content, XML-escaped |
null, empty object, empty array | A self-closing element <key/> |
"@key" keys | Attributes on the parent element |
"#text" key | The element's text content |
| Single key with object value | That key becomes the root element; otherwise <root> wraps the document |
There's no single standard for this mapping, every library invents its own. This page uses the convention that survives a round-trip: convert XML to JSON with the reverse tool, edit it, convert back, and attributes and text land where they started.
How this converter handles the details
- It validates the JSON first, syntax errors show the parser message with the exact position.
- Output is pretty-printed with two-space indentation and an
<?xml version="1.0"?>declaration. Need it minified? The desktop app exports Minified XML too. - Text is escaped, never mangled:
&,<, and>become entities; attribute values also escape quotes. - Invalid element names are repaired, not dropped: characters XML forbids in names become underscores, and names starting with a digit get a leading underscore.
- Everything runs locally. Your data never leaves the tab.
FAQ
How do I convert JSON to XML?
Paste your JSON into the input pane at the top of this page. The XML equivalent appears instantly in the output pane, copy it to your clipboard or download it as a .xml file. The conversion runs locally in your browser.
How does JSON map to XML elements?
Object keys become element names, scalar values become text content, and arrays become repeated elements: {"port": [8080, 9090]} produces <root><port>8080</port><port>9090</port></root>. A single top-level key whose value is an object becomes the root element; scalars, arrays, or multiple keys are wrapped in <root>.
Can I produce XML attributes from JSON?
Yes. Keys starting with @ become attributes on the parent element, and a "#text" key becomes its text content, the same convention our XML to JSON converter emits, so the two round-trip.
What happens to JSON keys that aren't valid XML names?
Characters that can't appear in an XML element name are replaced with underscores, and names that start with a digit get a leading underscore, "2fast" becomes <_2fast>. Everything else is escaped, never dropped.
Is my JSON uploaded to a server?
No. The converter is a small script that runs entirely in your browser. Your data never leaves your machine.
How do I convert a very large JSON file to XML?
Browser converters hold the whole document in tab memory, which gets painful past a few hundred megabytes. The jsonbolt desktop app parses the file at 3 GB/s, open the file (or press Win + J⌃ ⌥ J for clipboard JSON), select any subtree, then File → Export Selection Value As → Formatted or Minified XML.