Skip to content
Created by Iternal Technologies, the AI Strategy ExpertsBy Iternal (opens in a new tab)

Convert

JSON to XML

JSON

Paste JSON and the XML element appears as you type.

XML

About JSON to XML

JSON to XML turns a value into elements. An object with one key uses that key as the element name. Any other top-level value is wrapped in an element named root. Keys that start with @ are attributes, #text is the character data, and a string child is text. An array repeats its element once per item.

Text escapes ampersand, less-than, greater-than and double quotes. Attribute values also escape single quotes. A key that is not an XML name is reported instead of writing a broken tag. Numbers and booleans are written as their JSON text. Null and an empty string become an empty element.

Indent output is on by default and uses two spaces, with each child element on its own line. Turn it off for a compact document. A top-level array is wrapped in root and each entry becomes an item element. Swap moves the XML back to the JSON direction.

Frequently asked questions

How does a JSON object become XML?

An object with a single key names the element, and the value is its content. Any other top-level JSON value is wrapped in root. Keys that start with @ are attributes, #text is character data, and an array repeats the element. A string, number or boolean becomes text.

Which JSON keys are rejected?

A key that is not an XML name, such as one with a space or a leading digit, is a problem and nothing is written. The name after @ must be an XML name too. The key #text is reserved for character data and is not an element.

Which characters are escaped?

Element text escapes ampersand, less-than, greater-than and double quotes. Attribute values escape those plus single quotes. The file has no XML declaration. A top-level array is one root element whose children are named item.

Is the text I paste uploaded anywhere?

No. Conversion runs in your browser and the text you paste is never uploaded, logged or stored. Google Analytics records page views and feature use, never content.

  • XML to JSON

    Turn one XML element into JSON. Attributes become @ keys and direct text becomes #text or a string. It runs in your browser and your text is never uploaded.

  • Markdown to HTML

    Convert Markdown to clean HTML with a live preview. GitHub tables, task lists and footnotes included.

  • Markdown to DOCX

    Convert Markdown to a Word document (.docx) with a page preview. Tables, lists, footnotes and heading styles included.

  • JSON ↔ YAML

    Convert JSON to block YAML, or a YAML subset back to JSON.

  • CSV to JSON

    Convert a CSV table into a JSON array.

Iternal · AI Blueprint Builder

Plan the AI initiative, not just the output

The AI Blueprint Builder scores each use case across value, feasibility, cost, governance, risk, adoption and readiness before you commit budget. Free to start, about 60 minutes.

Open the AI Blueprint Builder (opens in a new tab)