JSON to XML Converter

Convert your JSON data to XML format with customizable formatting options.

Your JSON content

Converted XML

Pretty print
Indent
<?xml version="1.0" encoding="UTF-8"?> <company name="TechCorp" founded="2015"> <employees> <employee id="1" department="Engineering"> <firstName>John</firstName> <lastName>Doe</lastName> <email>[email protected]</email> <skills> <skill>JavaScript</skill> <skill>TypeScript</skill> <skill>Python</skill> </skills> <address> <street>123 Main Street</street> <city>San Francisco</city> <state>CA</state> <zip>94102</zip> </address> </employee> <employee id="2" department="Design"> <firstName>Jane</firstName> <lastName>Smith</lastName> <email>[email protected]</email> <skills> <skill>UI/UX</skill> <skill>Figma</skill> <skill>Adobe XD</skill> </skills> <address> <street>456 Oak Avenue</street> <city>Los Angeles</city> <state>CA</state> <zip>90001</zip> </address> </employee> </employees> <products> <product sku="PRD001"> <name>Cloud Platform</name> <price>99.99</price> <inStock>true</inStock> </product> <product sku="PRD002"> <name>Analytics Suite</name> <price>149.99</price> <inStock>false</inStock> </product> </products> </company>

How to Use This JSON to XML Converter

  1. Paste your JSON data into the input field.
  2. Configure conversion options such as root element name and indentation.
  3. The XML output is generated automatically in real time.
  4. Copy the XML result or download it as a file.

What is JSON to XML conversion?

This tool converts JSON (JavaScript Object Notation) data into XML (eXtensible Markup Language) format. JSON is widely used in web APIs and modern applications for its simplicity, while XML is commonly used in enterprise systems, configuration files, and SOAP web services.

Using Attributes

Use '_attributes' object in your JSON to add XML attributes to elements.

Features

  • Automatic conversion of nested JSON objects and arrays
  • Customizable root element name
  • Support for XML attributes via '_attributes' syntax
  • Formatted output with configurable indentation
  • Real-time conversion with error highlighting

Use Cases

  • Converting REST API responses to XML for SOAP-based systems
  • Generating XML configuration files from JSON data
  • Preparing data for legacy enterprise systems that require XML
  • Transforming JSON payloads for XML-based message queues
  • Creating XML feeds from JSON data sources

Frequently Asked Questions

How are JSON arrays converted to XML?

Each array item is wrapped in a repeating XML element. The element name is derived from the JSON key. For example, a 'users' array produces multiple <users> child elements.

Can I add XML attributes from JSON?

Yes. Add an '_attributes' object inside any JSON object to set attributes on the corresponding XML element. For example, undefined} becomes <element id="1">.

What happens with null or boolean JSON values?

Null values are converted to empty XML elements. Boolean values are converted to their string representation ('true' or 'false') as XML element text content.

Related Tools