Convert JSON objects and arrays into a simple XML representation in your browser.
JSON and XML have different data models. Arrays are emitted as repeated item elements and primitive values are serialized as text.
How to convert JSON to XML
- Paste valid JSON into the input. Use double quotes around object keys and text values; remove comments and trailing commas.
- Choose one root element name, such as
catalog. The converter places the whole document inside this element. - Select Convert to XML, review the result, and use Copy XML. Reset clears the input and generated output.
Example and mapping rules
For {"name":"Ada","active":true,"tags":["red","blue"]}, the name and active values become child elements. The tags array becomes a tags element containing two item elements. A null value becomes an empty element. An ampersand in a text value is escaped as &, so it remains text rather than XML markup.
This mapping is useful for inspecting simple data or preparing a starting point for an XML import. It does not create attributes, namespaces, a schema, or the particular element structure required by an external API. Check the receiving system’s specification before using the output.
What can change during conversion?
Object keys are adapted to element names: unsupported characters become underscores, and names starting with a number receive an n_ prefix. Different keys can therefore produce the same element name. Numbers, booleans and strings become text, so their original JSON types are not preserved. Empty strings, null values, empty objects and empty arrays may no longer be distinguishable after conversion. This is not a lossless round-trip format.
Common questions
Why does my JSON fail?
Check quotes, commas and brackets with the JSON Formatter. XML conversion starts only after JSON syntax is valid.
Can I convert very large data or numeric IDs?
Use small samples first. This browser tool limits input to 200,000 characters and nesting to 100 levels. Very large integers can lose precision when parsed as JavaScript numbers; represent identifiers as quoted strings when that matches your source data.
Will the XML meet my import schema?
Not automatically. Validate the result against the target schema and review adapted element names. Find related formatting utilities in Developer Tools.