JSON to XML

Convert JSON into well-formed XML markup instantly in your browser. Object keys prefixed with @ become attributes; everything else becomes nested elements.

Input
OutputREADY

Well-Formed Output

Produces properly escaped, indented XML with a single root element every time.

Handles Large Documents

Converts JSON up to 50MB without freezing the page.

Local Processing

Your data never leaves your browser. Privacy first conversion.

How to Convert JSON to XML

  1. Paste valid JSON into the input pane.
  2. Prefix any key with @ where you want an XML attribute instead of a child element — everything else becomes nested elements.
  3. Click Convert.
  4. Well-formed, indented XML with a declaration and a single root element appears in the output pane.

Example: Attributes, Elements, and Repeated Tags

Input — JSON with an @-prefixed key and an array

{"book":{"@id":"bk-101","title":"Clean Data","authors":{"author":["R. Vance","M. Osei"]}}}

Output — XML

<?xml version="1.0" encoding="UTF-8"?>
<book id="bk-101">
  <title>Clean Data</title>
  <authors>
    <author>R. Vance</author>
    <author>M. Osei</author>
  </authors>
</book>

The single top-level key becomes the root element, @id becomes an id attribute, and the two-item array becomes two repeated <author> elements.

The mapping rules in one breath

Object keys become element names, @-prefixed keys become attributes on the parent element, arrays repeat their parent tag once per item, and primitive values become text content. Because XML requires exactly one root, a document whose top level is a single key uses that key as the root element.

Escaping is handled for you

Characters with special meaning in XML — angle brackets, ampersands, quotes in attribute values — are escaped automatically during conversion, so string values containing markup-like text produce well-formed output instead of a broken document that chokes the next parser downstream.

Frequently Asked Questions

Related Tools