Favorite places of your favorite city
Home
Add to preferred sources on Google

JSON to XML

Convert JSON into an XML tree with a fixed element name for each value kind. Review the mapping before importing the result elsewhere.

JSON input

UTF-8 input up to 2 MiB, 20,000 values and 64 levels. XML output up to 8 MiB.

XML output

Conversion runs on your device. Your JSON and XML stay in this browser.

Convert JSON

  1. Paste JSON or choose a local UTF-8 file.
  2. Select Pretty or Compact and choose Convert.
  3. Review the typed XML, then copy it or download the file.

How values map

Objects become map elements and arrays become array elements. Each object member carries its original name in a key attribute.

String, number, boolean and null values each have their own element name.

The number element keeps the original JSON number token, including any exponent or trailing decimal digits.

Examples

A key named item id appears as a key attribute, so the space stays part of the name.

The JSON string 1 and the JSON number 1 appear in different elements.

Mapping and input limits

The converter rejects characters that XML 1.0 cannot represent and applies input, structure and output limits.

Use this mapping with workflows that accept typed elements. A destination expecting keys as tag names needs a separate mapping.

Local conversion

The browser converts your document on your device. The resulting XML is available to copy or download.

JSON to XML questions

The text inside a number element retains the admitted JSON token exactly.

Yes. The document root uses the element name corresponding to the JSON root kind.

Pretty indents container children. Compact keeps the same typed values with less layout whitespace.

It converts ordinary JSON into the typed format shown here. Restoring the original XML tree requires a different mapping.

Sources

Reviewed November 19, 2026.

JSON to TypeScript

Infer a TypeScript type alias from a JSON sample, then review, copy or download the code.

Open tool — JSON to TypeScript

JSON to YAML

Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.

Open tool — JSON to YAML

YAML to JSON

Convert one YAML document locally to JSON with exact number text and bounded aliases, then copy or download the complete result.

Open tool — YAML to JSON

JSON Diff Checker

Compare JSON values and see added, removed and changed paths.

Open tool — JSON Diff Checker

XML to JSON

Convert XML to an ordered JSON tree with attributes, namespaces and mixed content.

Open tool — XML to JSON

TOML to JSON

Convert TOML configuration to JSON with documented number and date handling.

Open tool — TOML to JSON

YAML Formatter

Format YAML indentation and copy the checked result while retaining comments and source details.

Open tool — YAML Formatter

XML Formatter

Check namespace-aware XML 1.0, format or compact locally, and copy or download UTF-8 output.

Open tool — XML Formatter

JSON Formatter & Validator

Check JSON syntax, format or minify locally, and copy or download output while preserving original data tokens.

Open tool — JSON Formatter & Validator
View all tools in this category