UtilitySansar
Dữ liệu

JSON to XML Converter

Generate well-formed XML from JSON with a configurable root element, optional XML declaration, and pretty indentation. Useful for SOAP payloads, RSS drafts, and legacy systems.

Tóm tắt công cụ

Công cụ này nhận đầu vào có cấu trúc và trả về đầu ra xác định ngay trong trình duyệt, không tải lên máy chủ.

Tên công cụ
JSON to XML Converter
Mục đích đầu vào
Cung cấp nội dung nguồn để biến đổi, xác thực hoặc phân tích.
Mục đích đầu ra
Nhận đầu ra chuẩn hóa thuận tiện để sao chép, tái sử dụng hoặc gỡ lỗi.
Đầu vào ví dụ
{"book":{"title":"Dune","author":"Frank Herbert","year":1965}}
Đầu ra ví dụ
<?xml version="1.0" encoding="UTF-8"?> <book> <title>Dune</title> <author>Frank Herbert</author> <year>1965</year> </book>

Paste JSON above and click Convert to XML.

Giới thiệu công cụ

Generate well-formed XML from JSON with a configurable root element, optional XML declaration, and pretty indentation. Useful for SOAP payloads, RSS drafts, and legacy systems.

Tổng quan công cụ

Each JSON key becomes an element; strings, numbers, and booleans become text content (XML-escaped). Arrays expand into repeated sibling elements with the same name. The top-level element defaults to `<root>`, but if your JSON has a single top-level key whose value is an object, that key is used as the root element instead — so the output stays natural.

Trường hợp sử dụng

  • Build a SOAP request body from a JSON fixture
  • Draft an RSS/Atom feed item from structured data
  • Feed legacy enterprise systems that require XML
  • Produce XML sitemaps from a JSON content list

Ví dụ đầu vào/đầu ra

Mục đích đầu vào
{"book":{"title":"Dune","author":"Frank Herbert","year":1965}}
Mục đích đầu ra
<?xml version="1.0" encoding="UTF-8"?>
<book>
  <title>Dune</title>
  <author>Frank Herbert</author>
  <year>1965</year>
</book>
Arrays expand into repeated sibling elements.
Mục đích đầu vào
{"library":{"book":[{"title":"Dune"},{"title":"Foundation"}]}}
Mục đích đầu ra
<?xml version="1.0" encoding="UTF-8"?>
<library>
  <book>
    <title>Dune</title>
  </book>
  <book>
    <title>Foundation</title>
  </book>
</library>
null values become self-closing tags; numbers and strings become text content.
Mục đích đầu vào
{"response":{"status":"ok","items":[1,2,3],"empty":null}}
Mục đích đầu ra
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <items>1</items>
  <items>2</items>
  <items>3</items>
  <empty/>
</response>

Câu hỏi thường gặp

Is this JSON to XML converter free?+
Yes. All processing is client-side, with no sign-up or file-size cap.
How are arrays represented?+
As repeated sibling elements sharing the parent key name. For example, {"tag":["a","b"]} becomes <tag>a</tag><tag>b</tag>.
How are special characters escaped?+
The five XML entities are escaped: <, >, &, ", and '. Numeric references like &#169; are preserved as-is.
Can I skip the XML declaration?+
Yes. Toggle "Include <?xml declaration?>" off before converting if you need a pure XML fragment (for embedding inside another document).
Can I generate XML for SOAP, RSS, or sitemaps?+
Yes. Set the root element to Envelope, rss, or urlset to match your target schema. The converter emits well-formed XML ready to feed into an XSD or SOAP tool.

Khám phá thêm công cụ

Khám phá các tiện ích liên quan trong danh mục Dữ liệu bên dưới.

Xem tất cả Dữ liệu

Công cụ liên quan

Tiện ích được tuyển chọn có thể hữu ích cho bạn