JSON to XML

Convert JSON into well-formed, indented XML with a custom root element. Free, in your browser.

Converts JSON to indented XML, in your browser.

Free to use — premium coming soon

FREE
  • Custom root
  • Escaped & indented
  • 100% private
PREMIUM
  • Remove ads
  • Attributes & XML→JSON

About the JSON to XML

JSON to XML takes data written in JavaScript Object Notation and rewrites it as an XML document. The two formats describe the same idea, a tree of named values, but they look different on the page. JSON uses curly braces, square brackets and key-value pairs, while XML wraps every value in opening and closing tags. This tool walks your JSON tree and emits one XML element per key, nesting child elements exactly as the original objects nest. The result is a well-formed document you can drop into a system that speaks XML rather than JSON, without retyping the structure by hand.

Reach for this converter when something downstream still demands XML. SOAP web services, most enterprise message buses, RSS and Atom feeds, sitemaps, Maven and Spring configuration files, Microsoft Office Open XML documents, and many government or banking APIs all expect XML and will reject JSON outright. If you already hold your data as JSON, from a REST call, a database export, or a frontend form, converting is far faster than building the XML from scratch. It is also handy for testing: paste a JSON sample, get XML, and feed it straight into a SOAP request or an XSD validator to see how the two shapes line up.

The conversion follows a few consistent rules. Each object key becomes an element tag and its value becomes the element's text. Nested objects become nested elements. Arrays are the awkward case, since XML has no array type, so each array entry is emitted as a repeated element sharing the same tag, which is exactly how XML normally expresses a list. Numbers, booleans and null lose their JSON types because XML treats everything as text, so 12, true and null all arrive as plain strings unless you add a type attribute. Reserved characters in values such as &, < and > are escaped to &amp;, &lt; and &gt; so the output stays well-formed.

Everything runs in your browser. The JSON you paste is parsed and converted on your own device using client-side JavaScript, so nothing is uploaded, logged, or stored on a server, which matters when the payload contains customer records, API keys, or internal identifiers. One accuracy caveat worth knowing: XML element names cannot begin with a digit or contain spaces, so a key like "123id" or "user name" must be sanitised, typically by prefixing an underscore or replacing spaces. Always validate the output against your target schema, because JSON and XML are not perfectly one-to-one and edge cases like attributes have no native JSON equivalent.

Frequently asked questions

How are JSON arrays converted to XML?

XML has no array type, so each element of a JSON array is written as a repeated element with the same tag name. For example {"item":[1,2,3]} becomes three separate <item> elements, which is the standard way XML represents a list.

What happens to numbers, booleans, and null values?

XML stores everything as text and has no native number, boolean, or null types, so 12, true, and null all appear as plain text inside their elements. If a downstream system needs the original type, conventions like adding a type="number" attribute can preserve it.

Why do some of my keys change in the XML output?

XML element names cannot start with a digit or contain spaces and certain symbols. Keys such as "123id" or "user name" are sanitised, usually by adding a leading underscore or swapping spaces for underscores, so the document stays well-formed.

Can XML attributes be recreated from JSON?

Not automatically, because JSON has no built-in notion of attributes. Many tools use a convention where keys prefixed with @ become attributes and a key like #text holds element text, but plain JSON will normally map every key to a child element instead.

Is my data sent to a server when I convert?

No. The conversion happens entirely in your browser with JavaScript, so the JSON you paste never leaves your device. That makes it safe to use with sensitive payloads such as customer data or credentials.

From our blog

Reading Epoch Time Like a Pro: A Practical Guide to Unix Timestamps

By the Super Simple Digital Tools Team · Updated June 2026

If you have ever opened a log file or an API response and found a field like 1700000000 where you expected a date, you have met Unix time. Rather than storing a fragile text string such as "Nov 14 2023 22:13 EST", computers prefer a single integer counting seconds from a fixed origin: midnight UTC on 1 January 1970. That origin is the epoch, and the count is the timestamp. One number, no formatting, no language or locale baked in, and trivial to compare or subtract. It is this simplicity that made epoch time the lingua franca of databases, network protocols, and operating systems.

Decoding one by hand is harder than it looks because the number hides three pieces of information at once: the unit, the sign, and the implied UTC reference. The single most common mistake is the unit. A value in seconds and the same instant in milliseconds differ by a factor of a thousand, so a 13-digit number fed into a tool expecting seconds will land you tens of thousands of years in the future. The fix is to glance at the digit count first: roughly ten digits means seconds for any present-day date, thirteen means milliseconds. When in doubt, paste it here and read both interpretations at once.

The second trap is time zones, and the cure is to remember that the raw number does not have one. A timestamp is a fixed point on a universal axis; only when you format it for display does a zone get involved. Two servers in different countries logging the same event will record the identical epoch value, even though their local clocks read different wall-clock times. That is exactly why epoch time is so useful for distributed systems, and why you should always confirm whether a displayed date is in UTC or in your own local zone before drawing conclusions during debugging.

The third thing worth understanding is what the number quietly omits. Unix time pretends every day has exactly 86,400 seconds and skips leap seconds entirely, the occasional one-second corrections that keep civil time aligned with the Earth's slightly irregular rotation. Twenty-seven of those have been added since 1970, so Unix time differs from true elapsed atomic time by that small amount. For almost all everyday work this is invisible, but it matters for high-precision scientific timing and explains why epoch time is not a perfect stopwatch of physical seconds.

Finally, keep the 2038 cliff on your radar. Software that still squeezes a timestamp into a signed 32-bit integer will run out of room at 03:14:07 UTC on 19 January 2038, after which the counter overflows and flips to a date in 1901. Sixty-four-bit storage pushes that limit hundreds of billions of years away, so the practical advice is to make sure long-lived systems, embedded devices, and database columns use 64-bit time. Understanding these four ideas, units, sign, time zone, and storage width, turns epoch time from a cryptic blob into a tool you can trust.

  • Check the digit count before converting: about 10 digits is seconds, 13 is milliseconds. Multiply or divide by 1000 to switch between them.
  • Always note whether the output you are reading is UTC or local time; the underlying timestamp itself carries no time zone.
  • When comparing two events, subtract their epoch values directly: the difference is the exact number of seconds (or milliseconds) between them, with no calendar math needed.
  • For any system expected to run past 2038, confirm timestamps are stored in 64-bit integers to avoid the 32-bit overflow that wraps dates back to 1901.

Read the full guide →

Tool by the Super Simple Digital Tools Team. Reviewed by our editorial team. Free to use, no signup required.

Related tools