Monu Tools

JSON 转 XML 转换器

完全在浏览器中,将 JSON 转为 XML,也可将 XML 转回 JSON,双向均可。

如何使用 JSON / XML

  1. 01

    选择方向:JSON 转 XML 或 XML 转 JSON。

  2. 02

    粘贴你的 JSON 或 XML。

  3. 03

    复制转换后的结果,或交换以转回。

Convert both directions

A two-way converter between JSON and XML, built on a well-tested parser. Convert a JSON object into XML or parse XML back into JSON, preserving attributes and turning repeated elements into arrays and back again.

It is handy whenever you need to bridge an XML-based system and a JSON-based one, inspect a SOAP payload as readable JSON, or turn a JSON config into the XML a legacy tool expects.

Everything runs locally in your browser, so your data never leaves your device.

Why XML is still everywhere

XML (Extensible Markup Language) is a long-established way to structure data with nested tags and attributes. It is still everywhere: SOAP web services, RSS and Atom feeds, office document formats, Android layouts and countless configuration and data-exchange formats.

How attributes are preserved

Attributes are preserved across the round trip using an @_ prefix on the JSON side, so an XML attribute becomes a clearly marked JSON key and converts back into the same attribute, rather than being lost or confused with child elements.

Repeated elements become arrays

Repeated elements map naturally to arrays: several <item> tags under a parent become a JSON array, and a JSON array becomes repeated elements in the XML, which is the shape most real documents take.

常见问题

XML 属性如何处理?

属性在 JSON 一侧使用 @_ 前缀保留,因此来回转换都能使它们保持完好。

重复元素如何表示?

重复的 XML 元素会变成 JSON 数组,JSON 中的数组会变成 XML 中的重复元素。

我的数据会被上传到服务器吗?

不会。转换完全在你的浏览器中运行,因此你的数据永远不会离开你的设备。

来源

嵌入此工具

将此工具添加到你自己的网站。复制下方代码片段即可,它会自动保持最新。

<iframe src="https://monu.tools/embed/zh/json-xml-converter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

相关工具