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.
Convert JSON
- Paste JSON or choose a local UTF-8 file.
- Select Pretty or Compact and choose Convert.
- 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
Sources
- W3Cw3.orgXML 1.0Defines the permitted characters, escaping rules and attribute normalization in XML.
- IETFrfc-editor.orgRFC 8259Defines JSON syntax, including strings and the spelling of number tokens.
- W3Cw3.orgfn:json-to-xmlThe W3C function uses its own namespace and escaping rules. This converter uses unnamespaced elements and a separate mapping.
Reviewed November 19, 2026.
Related tools
JSON to TypeScript
Infer a TypeScript type alias from a JSON sample, then review, copy or download the code.
Open tool — JSON to TypeScriptJSON to YAML
Convert JSON to YAML locally while preserving number text and quoted strings; copy or download the complete result.
Open tool — JSON to YAMLYAML 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 JSONJSON Diff Checker
Compare JSON values and see added, removed and changed paths.
Open tool — JSON Diff CheckerXML to JSON
Convert XML to an ordered JSON tree with attributes, namespaces and mixed content.
Open tool — XML to JSONTOML to JSON
Convert TOML configuration to JSON with documented number and date handling.
Open tool — TOML to JSONYAML Formatter
Format YAML indentation and copy the checked result while retaining comments and source details.
Open tool — YAML FormatterXML Formatter
Check namespace-aware XML 1.0, format or compact locally, and copy or download UTF-8 output.
Open tool — XML FormatterJSON Formatter & Validator
Check JSON syntax, format or minify locally, and copy or download output while preserving original data tokens.
Open tool — JSON Formatter & Validator