Skip to main content

XML Converter

Convert XML data to JSON, CSV, XLSX, or HTML table output, and reverse the process by transforming JSON or CSV back into well-formed XML. Attribute and nested-element structures are preserved during round-trip conversion, with configurable indentation, delimiters, and root element naming.

Your inputs stay in your browser

Everything you enter is processed on your device. This tool loads a code library from cdn.jsdelivr.net, which sees your IP address but never what you type.

Development
Web
Loading the tool
Reference

Documentation

An XML converter transforms XML into JSON, CSV, XLSX, or HTML table format, or runs the conversion in reverse, turning JSON or CSV back into well-formed XML. It parses nested elements, attributes, and text content, mapping them into the target structure while preserving hierarchy wherever the output format supports it.

Source data can be XML, JSON, or CSV, pasted directly or loaded from a file (.xml, .json, .csv, .xlsx, .html, or .txt). Indentation spacing (default 2) controls whitespace depth in JSON and XML output. CSV delimiter (comma, tab, or semicolon) sets the column separator for CSV output or input. XML root element name (default "root") names the wrapper element when generating XML from flat data. Array handling determines whether nested arrays stay hierarchical in the output or flatten into individual rows for CSV and other tabular formats.

Converting XML to JSON turns each element into a key in the resulting object; attributes appear under an @attributes key, and text content maps to a #text key. Repeated sibling elements of the same name merge automatically into an array rather than overwriting one another.

Converting JSON or CSV to XML turns each top-level key or column header into an element name; nested objects produce child elements, and array entries repeat the parent element name. A value that cannot serve as a valid XML element name is sanitized by replacing invalid characters with underscores.

XLSX output derives its column headers from the data's own keys, and a nested structure flattens into dot-notation headers (for example, "address.city") so every value occupies a single cell.

Data format mismatches arise frequently in development, analysis, and integration workflows. Converting between XML and other common formats bridges gaps between systems that expect different input shapes.

  • API Integration: Receive an XML SOAP response and convert it to JSON for consumption by a REST-based front end. Paste the XML payload, select JSON output, and obtain a structured object ready for parsing in JavaScript or Python.
  • Spreadsheet Reporting: Export XML transaction records from an accounting system and convert them to XLSX for pivot table analysis in a spreadsheet application. Flat array handling produces one row per transaction with columns for each data field.
  • Database Migration: Extract XML configuration files from a legacy system and convert them to CSV for bulk import into a relational database. Adjust the CSV delimiter to match the target system's import requirements.
  • Web Content Generation: Convert a product catalog stored in XML into an HTML table for embedding in a web page. Each element maps to a table row, with attributes and child elements filling the columns.
  • Configuration Auditing: Convert JSON configuration snapshots back to XML for comparison with canonical XML schema definitions. Preserve nesting depth and attribute placement so structural differences surface clearly in a diff tool.
  • Data Journalism: Download government XML data feeds containing census or budget figures and convert them to CSV for analysis in statistical software. Flatten nested categories into individual rows with dot-notation column headers to maintain context.
  • E-commerce Feed Conversion: Transform XML product feeds from suppliers into JSON for ingestion by a storefront API. Attribute data such as SKU, price, and availability maps to top-level keys, while nested description elements become string values.
  • Log Processing: Parse XML-formatted application logs and convert them to CSV for import into a log aggregation dashboard. Each log entry becomes a row with timestamp, severity, and message columns.
Inputs, outputs, and what the XML Converter computes

What the XML Converter asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • Input Format · default: XML
  • Source Data
  • Output Format · default: JSON
  • Indentation Spaces (numeric input) · default: 2 · range: 0 to 8
  • CSV Delimiter · default: Comma
  • XML Root Element Name (text input) · default: root
  • Array Handling · default: Nested (preserve structure)

Controls

Convert · Reset · Copy Output · Download