# JSON to XML Converter

Convert JSON data to XML format with customizable formatting options

> Canonical page: https://elysiatools.com/en/tools/json-to-xml

- **Category:** Format Conversion

- **Keywords:** json, xml, converter, transform, export, data, json to xml, xml converter

## Overview

The JSON to XML Converter is a streamlined utility designed to transform structured JSON data into valid XML format, offering flexible configuration options for root elements, indentation, and document declarations.

## Inputs

- **JSON Input** (textarea): Enter JSON data...
- **Root Element Name** (text): Name of the root XML element
- **Pretty Print** (checkbox)
- **Include Data Type Attributes** (checkbox)
- **Include XML Declaration** (checkbox)
- **Indent Size** (number): Number of spaces for indentation
- **Array Item Element Name** (text): Name for array item elements

## When to use

- When you need to integrate JSON-based web services with legacy systems that require XML input.
- When migrating data configurations from modern JSON formats to XML-based application settings.
- When preparing structured data for XML-based document processing or enterprise-level data exchange.

## How it works

- Paste your raw JSON data into the input field.
- Adjust settings such as root element name, indentation size, and whether to include an XML declaration.
- Click the convert button to generate the formatted XML output instantly.
- Copy or download the resulting XML code for use in your project.

## Use cases

- Converting API response payloads into XML for legacy system compatibility.
- Transforming JSON configuration files into XML format for Java or .NET applications.
- Standardizing data exports for XML-based reporting tools.

## Frequently asked questions

### Can I customize the root element name?

Yes, you can specify a custom name for the root XML element in the configuration settings.

### Does this tool support pretty printing?

Yes, you can enable pretty printing and define the specific indentation size in spaces.

### Can I include an XML declaration in the output?

Yes, the tool provides an option to include or exclude the standard XML declaration header.

### How are JSON arrays handled?

JSON arrays are converted into repeated XML elements, and you can define a custom tag name for these items.

### Is my data stored on your servers?

No, this conversion happens locally in your browser, ensuring your data remains private.

## Related tools

- [GeoJSON to OSM Converter](https://elysiatools.com/en/tools/geojson-to-osm): Convert GeoJSON format to OpenStreetMap (OSM) XML format
- [OSM to GeoJSON Converter](https://elysiatools.com/en/tools/osm-to-geojson): Convert OpenStreetMap (OSM) XML data to GeoJSON format
- [Excel to JSON Converter](https://elysiatools.com/en/tools/excel-to-json): Convert Excel file to JSON format, extracting data from the first worksheet
- [XML to JSON Converter](https://elysiatools.com/en/tools/xml-to-json): Convert XML data to JSON format with customizable parsing options
- [BOM Character Remover](https://elysiatools.com/en/tools/data-bom-remover): Remove BOM (Byte Order Mark) characters from text and file content. Perfect for cleaning up text files that have encoding issues, fixing CSV imports, and preparing data for processing. Features: - Detect and remove UTF-8 BOM (EF BB BF) - Detect and remove UTF-16 BOM (FE FF or FF FE) - Detect and remove UTF-32 BOM (00 00 FE FF or FF FE 00 00) - Support multiple input formats - Visual BOM character display - Detailed detection report - Support for batch text processing Common Use Cases: - Fix CSV file import errors - Clean up text file encoding issues - Prepare data for JSON parsing - Fix XML parsing problems - Resolve API data encoding conflicts - Standardize text data format
- [XLSX Conditional Formatting Rule](https://elysiatools.com/en/tools/xlsx-conditional-formatting-rule): Batch-apply conditional formatting rules such as threshold highlights, data bars, and color scales to Excel worksheets
- [XLSX JSON Transformer](https://elysiatools.com/en/tools/xlsx-json-transformer): Bidirectional conversion between JSON arrays and Excel sheets, with nested object flattening and restoration
- [XLSX Parquet Exporter](https://elysiatools.com/en/tools/xlsx-parquet-exporter): Export worksheet data to Parquet and/or NDJSON for data lake and data warehouse pipelines

## Samples

- [Android Serialization Java Samples](https://elysiatools.com/en/samples/android-serialization-java): Android Java serialization examples including JSON serialization, deserialization, and XML parsing
- [Android Serialization Kotlin Samples](https://elysiatools.com/en/samples/android-serialization-kotlin): Android Kotlin serialization examples including JSON serialization, deserialization, and XML parsing
- [macOS Data Serialization Swift Samples](https://elysiatools.com/en/samples/macos-serialization-swift): macOS Swift data serialization examples including JSON serialization, deserialization, and XML parsing
- [Web Data Serialization Go Samples](https://elysiatools.com/en/samples/web-serialization-go): Web Go data serialization examples including JSON encoding/decoding and XML parsing

## Related content

- [JSON Interchange and Format Translation Tools](https://elysiatools.com/en/hubs/json-convert): Compare JSON conversion tools for CSV, YAML, TOML, GraphQL, XML, Markdown, Excel, BSON, EDN, and related structured formats in one hub.
- [XML Conversion, Mapping, and XPath Tools](https://elysiatools.com/en/hubs/xml-convert): Curated tools for XML conversion, mapping, merging, and XPath extraction in one hub.
- [JSON Inspection, Diff, and Transformation Tools](https://elysiatools.com/en/hubs/json-utility): Compare JSON formatting, diffing, path inspection, schema validation, merging, transformation, and export tools in one hub for API and data workflows.
- [JSON Schema, Mock Data, and API Fixture Generators](https://elysiatools.com/en/hubs/json-generate): Curated tools for JSON schema generation, mock payload building, and API fixture preparation in one hub.
