JSON 转 XML 在线转换器

Free 免费 · 无需注册 · 数据不上传
Root
Array item
Indent
Error
JSON
XML
// XML output

更多开发工具

JSON 格式化
格式化、验证与压缩
XML 格式化
格式化与验证
XML→JSON
转 JSON
JSON→YAML
转 YAML 配置
JSON→CSV
转 CSV 表格
JSON→TOML
转 TOML 配置
HTML 格式化
格式化美化
正则表达式
实时测试

为什么这是最好的 JSON 转 XML 工具

即时转换

Convert JSON to well-formed XML in real-time as you type. Supports all JSON types including nested objects, arrays, strings, numbers, booleans and null.

Custom Root & Item Tags

Configure the root element name and the tag used for array items. This lets you produce XML that matches your target schema or existing API contract.

语法高亮

XML output is color-coded by tag name, attribute, and text content for easy readability and debugging.

下载 XML

Export the result as a .xml file for direct use in APIs, data pipelines, XSLT transforms, or any system that consumes XML data.

常见问题

How does JSON to XML conversion work?

Each JSON key becomes an XML element tag. Objects are converted to nested elements, arrays produce repeated elements (using the configured item tag name), and primitive values become text content inside their tag.

What happens to JSON arrays?

JSON arrays are converted to repeated XML child elements. You can customise the element name used for array items using the "Array item" option in the toolbar (default: <item>).

Are special characters escaped correctly?

Yes. All text content and attribute values are XML-escaped: & → &amp;, < → &lt;, > → &gt;, " → &quot;. The output is always well-formed XML.

Can I use this for SOAP or REST APIs that require XML?

Yes. The output is standard well-formed XML with an XML declaration. It can be used as a request or response body for SOAP services, XML-based REST APIs, or any system that consumes XML data.

深度指南
数据格式转换指南
CSV、XML、JSON、HTML 与 Markdown
阅读指南