Go to Sign up
Note: Your files never leave your device. We don't upload, transfer, or store your data.
JSON (JavaScript Object Notation), defined by RFC 8259, represents data as key-value pairs and ordered lists. It is the dominant format for web APIs, configuration files, and client-server communication.
XML (eXtensible Markup Language), defined by the W3C XML 1.0 Specification, represents data using nested elements enclosed in angle-bracket tags, with optional attributes, namespaces, and a strict well-formedness requirement. XML is used in SOAP web services, RSS/Atom feeds, configuration files (Spring, Maven, Android layouts), document formats (DOCX, SVG, XHTML), and legacy enterprise systems.
SOAP API integration — Many enterprise APIs require XML request/response bodies
Legacy system migration — Feed JSON-sourced data into systems that only accept XML
Configuration file generation — Produce XML config files from JSON templates
Document formats — Generate XML structures for DOCX, SVG, or Android layout files
RSS/Atom feed creation — Transform JSON data into syndication XML formats
Adobe/MS Office integration — Office Open XML formats (.docx, .xlsx) are XML-based
JSON and XML have different structural models. Key differences in conversion:
A JSON object {"name":"Alice","age":30} maps to nested XML elements:
<record>
<name>Alice</name>
<age>30</age>
</record>
A JSON array [1, 2, 3] maps to repeated XML elements using the row element name:
<record>1</record>
<record>2</record>
<record>3</record>
With Attribute Mode enabled, object properties render as XML attributes:
<record name="Alice" age="30"/>This produces more compact XML and matches common XML schema patterns where identifiers and metadata are attributes while content is child elements.
This tool runs entirely in your browser for JSON-to-XML transformation. Your data is never uploaded to any server. No data is transmitted, logged, or stored. The tool includes an Ace code editor with syntax highlighting and real-time JSON validation.
Every XML document needs a single root element. The Root Element field sets the outer wrapper tag name (default: dataset). The Row Element field sets the per-record tag name (default: record). For example, setting Root to employees and Row to employee produces <employees><employee>...</employee></employees>.
When enabled, the output begins with <?xml version="1.0" encoding="UTF-8"?>. This is required for well-formed XML documents and recommended when saving the output as a standalone .xml file. The encoding attribute matches the selected encoding option.
XML reserves five characters for markup: <, >, &, ", '. When enabled, the tool converts these characters in your JSON values to their entity equivalents (<, >, &, ", '). Always enable this when the output will be parsed by an XML processor.
CDATA (Character Data) sections wrap text content so that XML parsers treat it as raw character data, ignoring any markup-like characters within. A value like <script>alert(1)</script> wrapped in CDATA becomes <![CDATA[<script>alert(1)</script>]]>. Use CDATA when your JSON values contain HTML, code snippets, or arbitrary text that may include angle brackets or ampersands.
When enabled, JSON object properties are rendered as XML attributes on the row element rather than as child elements. This produces more compact XML and is useful when your XML schema distinguishes between attributes (metadata/identifiers) and elements (content). Note: XML attributes cannot contain nested structures, so objects and arrays remain as child elements.
Three encodings are available:
UTF-8 (default) — Universal, supports all Unicode characters
UTF-16 — For systems requiring 16-bit encoding (some Asian language environments)
ISO-8859-1 (Latin-1) — For legacy Western European systems
Choose 2-space, 4-space, 8-space, or tab indentation for readable output. Enable Minify Output to strip all whitespace for compact, production-ready XML.
Paste your JSON into the code editor, or drag and drop a .json file onto the upload area. Click Sample to load test data. The tool validates the JSON in real time — a green indicator confirms valid input.
In the Properties panel:
Root Element — Name for the outer XML wrapper (e.g., "employees", "products")
Row Element — Name for each record element (e.g., "employee", "product")
Encoding — Select UTF-8 (default), UTF-16, or ISO-8859-1
Indent Size — Choose indentation for readability
Escape XML Characters — Enable for well-formed XML output
XML Declaration — Enable for standalone .xml files
Minify Output — Enable for compact output
Attribute Mode — Enable to render properties as attributes
CDATA Wrapper — Enable if values contain HTML or special characters
Click Convert. The XML output appears in the Output Data panel. Click Copy to Clipboard to copy the code, or Download File (Premium) to save it as a .xml file.
XML supports mixed content (text interspersed with child elements). JSON has no equivalent. Each JSON value maps cleanly to either an element or an attribute — there is no way to represent <p>Hello <b>world</b></p> in standard JSON.
XML supports namespaces (xmlns:ns="..."). JSON has no namespace concept. If you need namespace-prefixed XML output, add namespace attributes manually after conversion or use a dedicated XML schema tool.
JSON has null. XML has no null concept. This tool renders null values as empty elements (<field></field>) or self-closing elements (<field/>), depending on the configuration.
All processing happens locally in your browser using JavaScript. Your files are never uploaded, transferred, or stored on any server. The tool works offline after the page loads.
JSON objects, arrays, and nested combinations. Objects map to XML elements (keys become tag names). Arrays map to repeated elements. Nested objects produce nested XML elements.
The root element is the outermost XML tag that wraps all content. Every well-formed XML document must have exactly one root element. The default is dataset — change it to match your schema (e.g., employees, products, orders).
The row element is the tag name used for each item in a JSON array. The default is record. For example, converting a JSON array of employees, set the row element to employee so each item is wrapped in <employee>...</employee>.
CDATA sections tell the XML parser to treat their content as raw text, ignoring any <, >, or & characters. Enable CDATA when your JSON values contain HTML markup, code snippets, or arbitrary text with characters that would otherwise be interpreted as XML syntax.
When enabled, JSON properties render as XML attributes on the parent element instead of child elements. For example, {"id":1,"name":"Alice"} becomes <record id="1" name="Alice"/> instead of <record><id>1</id><name>Alice</name></record>. Objects and arrays cannot be attributes — they remain as child elements.
The XML declaration (<?xml version="1.0" encoding="UTF-8"?>) is an optional but recommended header line at the start of an XML document. It tells XML parsers the version and character encoding. Enable it when saving the output as a standalone .xml file.
This tool converts in one direction: JSON to XML. For the reverse, use the XML To JSON Converter on A.Tools.
The button is disabled when the input JSON is invalid. Fix syntax errors until the validation indicator turns green.