Convert JSON to XML with real control - map @key fields to XML attributes,
set a custom root element, choose how arrays become repeated elements, and preview
the result as an interactive tree alongside the raw XML.
XML output appears here
Paste JSON or load a sample to begin
What makes it different
Real attribute mapping, a configurable root element, array handling options, and a live tree you can explore - not just a wall of angle brackets.
Explore your XML as a collapsible tree - click any element to expand or collapse its children, just like a file browser.
click to expand/collapse@id becomes a true XML attribute, not a child element - following the convention used by Newtonsoft, FreeFormatter, and most XML libraries.
Name your root element to match your API resource - <Order>, <Catalog>, whatever your schema needs.
Choose repeated elements (<tag>...</tag><tag>...</tag>) or wrapped <item> containers - toggle to compare both.
Wrap text content in <![CDATA[ ]]> so HTML, code, or special characters in your JSON strings don't need escaping.
Invalid JSON shows the exact line and column with a clear explanation - no cryptic parser messages.
line + column shownQuick guide
Handles attributes, arrays, and deep nesting.
Paste a JSON object or array, or drag and drop a .json file. Invalid JSON is flagged with line and column immediately.
Set a root element name, decide how arrays are represented, toggle attribute mapping, indentation, and CDATA.
Browse the interactive tree to verify structure, then copy the raw XML or download it as a .xml file.
JSON and XML represent data very differently. JSON has objects, arrays, and primitive types. XML has elements, attributes, and text content - with no native concept of arrays or booleans. Converting between them means making a series of conventions explicit, and getting them right is the difference between XML that "looks okay" and XML that actually validates against a schema.
The most common convention, used by Newtonsoft's Json.NET, FreeFormatter, and most JSON-XML libraries, is to prefix a key with @ to mark it as an XML attribute rather than a child element. So:
{"@id": "42", "name": "Rahul"}
becomes:
<root id="42"><name>Rahul</name></root>
When an element needs both attributes and text content, a special #text key holds the text value alongside the @-prefixed attributes.
XML has no array type. A JSON array like "tags": ["new", "sale"] is conventionally represented as repeated elements with the same tag name: <tags>new</tags><tags>sale</tags>. Some schemas instead expect array items wrapped in a generic container, like <tags><item>new</item><item>sale</item></tags>. This tool supports both - pick whichever matches the schema you're integrating with.
XML text content is always a string - there's no native boolean or number type. A JSON true becomes the text true, and a JSON null becomes an empty element. If the system consuming your XML needs typed values, it typically uses an xsi:type attribute or a separate schema (XSD) to specify expected types - this is outside what a generic converter can infer.
<, >, or & - for example, HTML snippets or code samples - these normally need to be escaped as <, >, and & in XML. Enabling CDATA wraps the text in <![CDATA[ ... ]]> instead, telling the XML parser to treat everything inside as literal text with no escaping needed.
| JSON | XML output |
|---|---|
| {"name":"Rahul"} | <root><name>Rahul</name></root> |
| {"@id":"42","name":"Rahul"} | <root id="42"><name>Rahul</name></root> |
| {"tags":["a","b"]} | <root><tags>a</tags><tags>b</tags></root> |
| {"active":true} | <root><active>true</active></root> |
| {"note":null} | <root><note/></root> |
Many banking, insurance, and government systems still require XML - convert modern JSON APIs to feed them.
Generate XML fragments that match the structure expected by SOAP-based web services.
Convert structured data into XML for RSS, Atom, or sitemap-style feeds.
Some build tools and frameworks (Maven, Spring, MSBuild) use XML configuration - convert JSON config drafts to XML.
Migrating from an XML-based system to JSON, or vice versa - use this alongside an XML to JSON tool for round trips.
See how familiar JSON data maps to XML elements and attributes - useful for understanding XML schemas.
FAQ
Everything about attributes, arrays, and XML conventions.
Ask a question{"@id": "42", "name": "Rahul"} becomes <element id="42"><name>Rahul</name></element>. This follows the same convention used by most JSON-XML libraries. Try the "With attributes" sample to see it in action.{"@id":"1","#text":"Hello"} becomes <element id="1">Hello</element>.