跳转到主要内容
CuteJSON
↑↓ 导航 Enter 选择 Esc 关闭

JSON to XML Converter

Convert between JSON and XML without either document leaving your browser.

返回所有工具
Namespaces and custom mapping

These settings change how attributes, text and namespace prefixes cross between JSON and XML. The defaults match the mapping described above.

键盘快捷键

这些快捷键在页面上对应操作存在时有效。

打开命令面板
Ctrl/Cmd + K
运行主要操作
Ctrl/Cmd + Enter
格式化
Ctrl/Cmd + Shift + F
压缩
Ctrl/Cmd + Shift + M
复制输出
Ctrl/Cmd + Shift + C
打开文件
Ctrl/Cmd + Shift + O
下载输出
Ctrl/Cmd + S
关闭此对话框
Esc
打开此对话框
F1 / ?

本地数据

以下所有内容仅存储在此浏览器、此设备上。

未保存的草稿
记住选项的工具

最近打开的文件

    此设备上尚未打开任何文件。

    通过链接分享

    内容被打包在链接 # 号之后的部分。

    分享此页面上的第一个输入。

    暂无可分享的内容。

    JSON

    从 URL 加载

    直接从浏览器获取 URL。

    XML

    结果将显示在此处。

    完全在您的浏览器中运行。

    关于此工具

    XML has no single mapping onto JSON, so this tool picks one and states it on the page instead of pretending there is a natural one. Writing, an object becomes an element per member and an array becomes repeated sibling elements under a root element whose name you choose, because JSON has nothing that names an object the way a root element does. A member name that is not a legal XML element name stops the conversion and is named. An attribute becomes a key prefixed with @ and text sitting next to child elements becomes a #text key, and neither @ nor # is a legal XML name character, so a JSON key can never collide with them. A null becomes an empty element, and so do an empty object, an empty array and an empty string, because XML has one shape for nothing and cannot tell them apart, so they all read back as null. Reading, every value is a string, because XML records no types and guessing them is how a postcode becomes a number. A repeated element name becomes an array. The reader handles comments, CDATA, entity references and a DOCTYPE, and reports anything else with its position. The attribute prefix, the text key and namespace handling are all configurable in Namespaces and custom mapping, for a document that uses a different convention.

    使用方法

    1. Choose a direction, then paste your document into the left pane or load the sample.
    2. Press Convert. Writing, you can name the root element first.
    3. Copy the result or download it as a file.