Skip to content

XML to Excel

Turn XML records into an Excel spreadsheet.

Drop an XML file here

Only your browser reads them.

How to use XML to Excel

  1. Drop your XML file. Select or drag any .xml document onto the upload area.
  2. Build the Excel workbook. Click Convert to Excel to detect repeating records, type-check cells, and package the .xlsx file locally.
  3. Download and open in Excel. Review the row and column summary, then save the .xlsx file to your device.

Your files are processed on this device and never uploaded. They stay private, and there's nothing to delete afterwards.

How to convert XML to Excel online into a native XLSX workbook?

Dropping an .xml file onto the tool decodes UTF-8 bytes inside a Web Worker, locates the repeating record elements, and assembles a complete .xlsx ZIP package in memory without uploading your data. You can convert XML to Excel online without installing desktop office software or registering an account.

Detecting repeating records and flattening nested XML tags

Before building any spreadsheet cells, the worker runs a breadth-first scan across the parsed XML tree to find repeating sibling elements. Structured record containers such as <orders>/<order> receive a 10× scoring boost over nested scalar lists so line-item tags never hijack the main row structure.

During XML schema attribute parsing, attributes become @attribute columns, nested elements become parent/child paths, and repeated sibling values join with "; ". Before converting complex feeds, you can validate and indent XML tags before exporting to inspect the exact tag hierarchy.

Building an ECMA-376 OOXML ZIP package in a Web Worker

Under the ECMA-376 Office Open XML File Formats Standard, a modern .xlsx file is a ZIP archive containing [Content_Types].xml, _rels/.rels, xl/workbook.xml, xl/styles.xml, and xl/worksheets/sheet1.xml. Rather than loading heavy spreadsheet suites, makeXlsx() writes those five XML parts directly and compresses them at ZIP level 6.

Using inlineStr cells instead of a separate shared-strings table lets the worker generate large worksheets in a single pass with low memory overhead. Because every part is generated deterministically in worker memory, the resulting .xlsx file opens cleanly in Microsoft Excel, LibreOffice Calc, Apple Numbers, and Google Sheets.

Keeping real numbers computable while protecting leading zeros and long IDs

Converting XML text naively to Excel creates two opposite headaches: either every price and quantity exports as text that breaks SUM(), or Excel silently mangles postal codes and 18-digit transaction IDs.

Applying the 15-significant-digit IEEE-754 precision guard

To solve both problems, every data cell passes through isSafeSpreadsheetNumber(). Values matching -?(0|[1-9]\d*)(\.\d+)? with 15 or fewer significant digits become true numeric <v> cells ready for formulas and charts.

According to the MDN Number.isSafeInteger IEEE 754 precision reference, JavaScript and Excel both lose integer exactness above 53 bits (9,007,199,254,740,991) and round beyond 15 significant digits. Any string with leading zeros (00412) or more than 15 significant digits stays an inlineStr text cell so bank accounts, barcodes, and tracking numbers never corrupt.

Bold header styling and 8-to-60 character column widths

Row 1 receives a dedicated bold Calibri 11pt style (s="1") defined in xl/styles.xml, while data rows use the default style (s="0"). Column widths auto-fit to the longest string in each column plus 2 characters, clamped between 8 and 60 characters, and you can convert flat tabular exports into JSON arrays if a downstream API needs JSON instead of a workbook.

Cell input example isSafeSpreadsheetNumber() result Stored OOXML cell type Excel behavior
149.95 true (5 significant digits) Numeric <v>149.95</v> Works in SUM() and numeric sorting
-42 true (safe integer) Numeric <v>-42</v> Preserved as negative number
00412 false (leading zero) Text inlineStr Keeps 00412 intact without stripping zeros
123456789012345678 false (18 digits > 15) Text inlineStr Avoids scientific notation and last-digit rounding
Empty tag <note/> Blank (null) Omitted cell Clean empty cell in worksheet

Handling UTF-8 XML feeds, single records, and parse errors

Real XML files arrive with namespaces, empty tags, and single-record wrappers that trip up basic converters. The parser handles those structural edge cases deterministically before building the sheet.

Decoding UTF-8 bytes and stripping namespace prefixes

Under the W3C Extensible Markup Language (XML) 1.0 Specification, element names may carry namespace prefixes such as ns1:invoice alongside xmlns attributes. The parser strips prefixes (local()) and skips xmlns attributes so headers stay clean, while rejecting empty or non-XML files with an actionable error.

Standard XML character entities (&amp;, &lt;, &gt;, &quot;, &apos;), numeric character references, and CDATA sections are decoded automatically before cells are written.

Unwrapping single-record XML wrappers cleanly

When an export contains just one record nested inside wrapper tags like <export><orders><order id="1">...</order></orders></export>, the detector unwraps pure container nodes until it reaches <order>. It also skips empty elements cleanly and preserves every attribute on the single record as its own column. If your XML files arrive inside a compressed bundle, unpack them first with a browser ZIP archive extractor before converting.

Comparing XLSX vs CSV for XML data exports

Choosing between .xlsx and .csv depends on whether a human analyst or an automated script will read the output next. Native .xlsx workbooks preserve numeric cell types, bold header styling, and column widths, whereas plain CSV exports prioritize raw portability.

Inside the worker, file bytes are decoded using the MDN TextDecoder UTF-8 decoding reference before entering either the CSV or XLSX branch. Choose XML to CSV when feeding databases or Python scripts that expect plain RFC 4180 text, and choose .xlsx when sharing formatted tables with Excel users.

Because the entire workbook assembly runs in local memory using fflate ZIP compression, confidential financial, inventory, and database exports never touch an external server. When you click Convert to Excel, the worker returns a standard application/vnd.openxmlformats-officedocument.spreadsheetml.sheet file ready for immediate spreadsheet analysis, pivot tables, and chart generation.

Tip: Because makeXlsx() names the worksheet tab after the detected record tag (such as order or product), check the result note below the download button to verify which XML element became your table rows.

Questions

How are nested XML tags and attributes stored in Excel?

Attributes become columns prefixed with @ such as @id, and nested child tags become slash-separated paths like customer/name. Repeated sibling tags within one record are joined with a semicolon and space so no values are lost.

Why do long IDs and leading-zero codes stay formatted as text?

Excel uses IEEE-754 double precision, which rounds numbers beyond 15 significant digits and strips leading zeros from ZIP codes or invoice numbers. This converter checks each value with isSafeSpreadsheetNumber and stores risky strings as inlineStr text.

Are numbers exported as real Excel values for SUM formulas?

Yes. Clean integers and decimals up to 15 significant digits without leading zeros are written as numeric spreadsheet cells so SUM, AVERAGE, and sorting work immediately without manual text-to-columns conversion.

How does the converter name the worksheet tab and column widths?

The sheet tab is named after the detected repeating record tag, sanitized to Excel's 31-character tab limit. Each column width is calculated from the longest cell value plus 2 characters, clamped between 8 and 60 characters.

What happens if an XML file has only a single record?

If no repeating sibling group exists, the parser unwraps outer container tags that hold only a single child element and exports that record as a 1-row table with its column headers.

Is my sensitive XML database export uploaded to external servers?

No. Your XML file is read as a local byte array, decoded inside a browser Web Worker, and packaged into an .xlsx Blob in device memory. Zero bytes are transmitted to external servers.

Updated