Browser-local data converter

JSON to XML Converter

Turn JSON objects and arrays into readable XML in your browser.

JSON to XML

Processed in this browser
Paste JSON
Ready to copy

How to use it

A short path from source data to a usable local result.

01

Paste JSON

Add an object with a clear root key.

02

Convert locally

The browser walks objects, arrays, attributes, and text values.

03

Take the XML

Copy the result or download converted.xml.

Common questions

Details that matter when moving data between formats.

What is the root element?

The first top-level JSON key becomes the XML root element.

How do arrays map?

Each array item becomes a repeated element with the same key.

How are attributes represented?

An `_attributes` object becomes XML attributes on that element.

Can any JSON become XML?

Objects and arrays map cleanly; top-level scalars need a root object.

Related tools

Other focused converters that are already available.

When is JSON to XML useful?

JSON to XML conversion is useful when a modern application produces JSON but a legacy integration, feed consumer, or configuration tool still expects XML. It can also help when a developer needs a readable XML fixture from a small JSON object. This page performs the mapping inside the browser, shows the result in a text area, and lets you copy or download it. It does not send JSON to a remote parser and it does not attempt to guess a business schema.

The mapping is explicit. The first top-level key becomes the root element, object keys become child elements, and arrays become repeated sibling elements. An object named `_attributes` supplies XML attributes, while `_text` supplies text content when an element also has attributes or children. Ordinary scalar values become escaped text. Element names and attribute names are escaped in the output, and text characters such as ampersands and angle brackets are encoded so the result remains well formed. This makes the output predictable for small structured documents.

XML has rules that JSON does not express: namespaces, mixed-content order, comments, processing instructions, schemas, and attributes are all separate concepts. A JSON object with several unrelated top-level keys therefore needs a deliberate root wrapper. Arrays of objects should use consistent keys, and values such as dates or identifiers remain text unless the consuming XML schema says otherwise. Review the generated document before sending it to a strict validator. The page does not validate a remote endpoint, preserve comments, or store your source after refresh.

Names are the most common failure point. XML element names cannot start with a digit and cannot contain spaces, so a JSON key such as 2fa or order total needs renaming before conversion; the page does not rewrite keys for you. A key named _attributes is read as the attribute bag and _text as the element text, which lets a round trip keep both, but it also means a genuine JSON field with either name is interpreted rather than emitted. The declaration is fixed to UTF-8, so non-ASCII text is safe, yet characters that are illegal in XML 1.0 are not stripped.