JSON WalletPrivacy-first JSON & API workspace

JSON to XML

Convert a JSON document to XML. Objects become nested elements, arrays repeat their element, and &, <, > are escaped safely.

Input
XML

Convert JSON to XML in the browser

Plenty of enterprise systems, SOAP services, RSS feeds and legacy integrations still speak XML rather than JSON. When you have data in JSON β€” an API response, a config object, a database export β€” and need to hand it to one of those systems, this converter produces a clean, well-formed XML document. Objects become nested elements, arrays become repeated elements, and every value is escaped so the result is always valid.

How to use it

  1. Paste a JSON object into the input, or click Load sample to start from example data.
  2. Optionally set the Root element name to match what the target system expects.
  3. The XML appears on the right as you type. Use Copy or Download to save it as a .xml file.

A worked example

This JSON:

{ "id": 10, "name": "Ada Lovelace", "roles": ["admin", "developer"] }

produces this XML:

<?xml version="1.0" encoding="UTF-8"?>
<root>
  <id>10</id>
  <name>Ada Lovelace</name>
  <roles>admin</roles>
  <roles>developer</roles>
</root>

The array of roles expands into two <roles> elements β€” the idiomatic XML pattern for a repeated value β€” while the scalar fields map to simple child elements.

When you would reach for it

Posting data to a SOAP endpoint, generating a sitemap or RSS fragment, feeding a reporting tool that imports XML, or migrating a JSON fixture into an XML-based test suite. If you need to go the other way, pair it with the XML to JSON converter; to inspect the source JSON first, open it in the JSON editor.

Privacy

Conversion happens locally in your browser and the tool works offline after it loads. Your JSON is never transmitted or stored, making it safe for payloads that contain customer data or internal identifiers.

Frequently asked questions

How are arrays represented?

Each array item is emitted as a repeated element with the same tag name as its parent key. So "roles": ["admin", "developer"] becomes two <roles> elements rather than a single element containing a list β€” the standard way to express repetition in XML.

What about invalid element names?

XML tag names cannot contain spaces or most punctuation and cannot start with a digit. Any character that is not valid is replaced with an underscore so the output always parses.

How are special characters handled?

The five XML entities are escaped automatically: &, <, >, " and '. That means a value like a & b is written safely as a &amp; b and will not break the document.

Can I set the root element name?

Yes. Use the Root element field above to name the wrapper element (it defaults to root). This is useful when the receiving system expects a specific top-level tag.

Does it add an XML declaration?

Yes β€” the output begins with <?xml version="1.0" encoding="UTF-8"?> so it is a well-formed standalone document you can save as a .xml file.

Is my data uploaded?

No. The conversion runs entirely in your browser; your JSON never leaves your device.

Press ⌘ K for commands