代码、数据与二维码工具

JSON转XML

提供JSON转XML的交互处理。

优先本地处理无需注册隐私说明 ↗

Enter any valid JSON value. Maximum 100,000 characters.

使用步骤

如何使用

  1. Paste valid JSON and choose the root element name and array item name.
  2. Convert the value and review normalized XML element names and escaped text.
  3. Copy the XML or download it as an XML file.

Predictable JSON-to-XML mapping

Objects become child elements. Arrays become a parent element with repeated item elements. Primitive values become text, while null and empty strings become self-closing elements. The root is always wrapped in the chosen root element.

Safe XML names and text

Element names are trimmed, invalid characters become underscores, and names beginning with a digit or hyphen receive a leading underscore. Ampersands, angle brackets, quotes, and apostrophes are escaped in text. Processing instructions, attributes, and external entities are never generated.

常见问题

你可能还想知道

Can a JSON array be the root?

Yes. The selected root element contains one repeated item element for each array value.

What happens to invalid JSON keys?

Keys are normalized into valid XML element names. Distinct keys that normalize to the same name receive a numbered suffix.

Does conversion upload my JSON?

No. Parsing, conversion, copying, and download preparation happen locally in your browser.