Skip to main content
ToolsBay

Runs in your browser — nothing is uploaded · verify

JSON to XML — free, and it runs in your browser

Convert JSON structures into equivalent XML markup.

  • Arrays become repeated elements, which is the mapping receiving systems expect.
  • For the SOAP endpoint, the legacy integration or the schema that will not take JSON.
  • Characters that would break the markup are escaped as they are written.

JSON input

Tab indents · Esc then Tab to leave1 line

XML output

1 line
  • 70 tools

    Free, with no account and no watermark

  • 0 bytes

    Of your files or text uploaded — this tool runs in the tab

  • No queue

    The work happens in this tab, not in a line behind other users

Three steps, nothing to install

JSON to XML in three steps

  1. JSON123456Paste it in — it never leaves the tab

    Paste your JSON

    Objects, arrays and nesting are all handled. Wrap a top-level array in an object if you need a single root element.

  2. JSONXMLConverted on your own device

    Map it onto elements

    Keys become element names and arrays become repeated elements, which is the conversion the receiving system almost always expects.

  3. Copy XML

    Copy the XML

    Indented and ready to paste into a request body or a fixture.

Why use JSON to XML

  • Escaped as it is written

    Ampersands and angle brackets inside values are turned into entities, so a value containing markup does not silently become markup.

  • Parsed, not pattern-matched

    The input is read with a real parser and the output is written from what it found, rather than by rewriting the text with regular expressions.

  • Your text stays in the page

    What you paste is not transmitted or stored, so an API response full of customer records, a token or an internal query never leaves your machine.

Frequently asked questions

By repeating the element. XML has no array type, so ["a","b"] under the key "item" becomes two <item> elements. That is the standard convention and what XML parsers expect.

Converting a JSON tree to XML

JSON and XML both describe hierarchical data, but they do not map onto each other perfectly. JSON has arrays, numbers, booleans and null as distinct types. XML has elements, attributes and text, and everything is a string.

The conversion here takes the common, predictable approach: object keys become element names, array items repeat the element, scalars become text content, and null becomes an empty element. Nothing is turned into an attribute, because JSON gives no signal about which values were meant to be attributes.

Where you still need XML

SOAP web services, RSS and Atom feeds, sitemaps, office document formats and a great deal of enterprise and government integration all speak XML. If you are producing data for one of those and your source is JSON, this is the bridge.

Going the other direction, use XML to JSON. For an XML sitemap specifically, the sitemap generator produces the exact format search engines expect.

  • XML to JSON

    Convert XML documents into readable JSON.

  • XML Beautifier

    Format, minify and check XML without mangling CDATA or attributes.

  • JSON Formatter

    Pretty-print JSON with the indentation you choose, or minify it.

  • Regex Tester

    Test regular expressions live with match highlighting and groups.

  • SQL Formatter

    Indent and align SQL for PostgreSQL, MySQL, SQLite, BigQuery, Snowflake and SQL Server, with keywords capitalised.

  • YAML Validator

    Validate YAML syntax and preview the parsed result as JSON.

Related guides

More tools

70 tools, none of which want your file

Everything this tool does happens in the page you are looking at. No account, no upload, no watermark.