Skip to content
JSON to XML

JSON to XML

Convert JSON to XML online. Paste any valid JSON, set a root element name, and copy or download well-formed XML.

Converts JSON to XML Custom root element name Optional XML declaration Pretty-printed indentation Handles nested objects and arrays Copy and download XML output Import JSON from URL or file Theme switcher Fullscreen editor mode

Input JSON

Paste your JSON here

XML Output

Copy or download the converted XML

Key Features

  • Converts JSON to XML
  • Custom root element name
  • Optional XML declaration
  • Pretty-printed indentation
  • Handles nested objects and arrays
  • Copy and download XML output
  • Import JSON from URL or file
  • Theme switcher
  • Fullscreen editor mode

How to Use

  1. Paste your JSON into the input editor.
  2. Set a root element name (e.g. data, response).
  3. Click Convert to generate XML.
  4. Copy or download the XML output.
  5. Need the reverse? Use the XML to JSON converter.

Free Online JSON to XML Converter

Convert JSON objects into clean, well-formed XML with our online JSON to XML converter. Useful when integrating modern JSON APIs with legacy XML systems, generating SOAP request bodies, building RSS or sitemap feeds, or producing structured data for tools that only accept XML.

How the conversion works

  • Object keys become XML element names
  • Array items become repeated elements with the same tag
  • Primitive values (strings, numbers, booleans) become element text content
  • Null becomes a self-closing element
  • Invalid XML names are sanitized (e.g. a key starting with a digit is prefixed with an underscore)

Customisable output

  • Root element name: Default is root — change it to response, data, or anything you need
  • XML declaration: Toggle the <?xml version="1.0" encoding="UTF-8"?> prolog on or off
  • Indentation: 2 or 4 spaces for pretty output, or minify for compact transmission

Common use cases

  • Generate XML payloads for SOAP-based services
  • Translate REST responses into XML for legacy reporting tools
  • Build sitemap, RSS, or Atom feeds from JSON sources
  • Produce sample XML files from JSON test fixtures

Pair with related tools

After converting, run the result through the XML Formatter for additional polish or the XML Validator to confirm well-formedness. To convert back, use the XML to JSON converter.

Privacy

Conversion runs in your browser. No data is sent to any server.

Latest from Our Blog

Tips, tutorials, and insights about web development