Skip to content

JSON to XML Converter

Convert any JSON object to a well-formed XML document instantly. Set a custom root element, and copy or download the output as a .xml file.

Paste your JSON object to convert it into an XML document

The wrapping root tag name (default: root)

XML Output
<?xml version="1.0" encoding="UTF-8"?> <root> <person> <name>Alice</name> <age>30</age> <email>alice@example.com</email> <hobbies>reading</hobbies> <hobbies>coding</hobbies> <hobbies>hiking</hobbies> </person> </root>
Lines
11
Characters
245
XML Output
<?xml version="1.0" encoding="UTF-8"?>
<root>
  <person>
    <name>Alice</name>
    <age>30</age>
    <email>alice@example.com</email>
    <hobbies>reading</hobbies>
    <hobbies>coding</hobbies>
    <hobbies>hiking</hobbies>
  </person>
</root>

使い方

計算式

Recursive DOM serialization: each JSON key becomes an XML element

計算例

{"person":{"name":"Alice","age":30}} converts to <root><person><name>Alice</name><age>30</age></person></root>

JSON vs. XML: When to Convert

While JSON is the dominant format for modern REST APIs, XML remains standard in:

  • Enterprise integrations (SOAP web services, EDI systems)
  • Document formats (XHTML, SVG, Microsoft Office XML)
  • Configuration files (Maven pom.xml, Android AndroidManifest.xml)
  • Legacy system APIs that predate JSON adoption

Converting JSON to XML allows you to bridge modern JSON-producing systems with XML-consuming integrations without writing custom serialization code.

XML Naming Conventions

XML element names must start with a letter or underscore and cannot contain spaces. The root element name you configure is automatically sanitized to remove invalid characters.

よくある質問

How are JSON arrays converted to XML?

Each array item becomes a separate element with the array's key name as the tag. For example, 'hobbies: ["reading","coding"]' becomes <hobbies>reading</hobbies><hobbies>coding</hobbies>.

Does the converter handle nested JSON?

Yes. Nested objects and arrays are recursively converted, preserving all nesting levels in the output XML.

What happens to null values?

JSON null values are rendered as self-closing empty tags, e.g. <field/>, which is standard XML convention for absent or null values.

Does the output include an XML declaration?

Yes. The output always includes the standard <?xml version="1.0" encoding="UTF-8"?> declaration as the first line.

最終更新日: 2026年3月19日