XML to Excel
XML to Excel
The same flattening as XML to CSV, but the result is an actual .xlsx workbook rather than a text file Excel has to guess at on import. The header row is frozen and filterable, columns are sized to their content, and numbers arrive as numbers. The whole package is assembled in the page — nothing is uploaded.
Why not just save the CSV
A CSV is a suggestion; a workbook is a statement. Everything Excel does on CSV import is a guess
informed by your locale, and the guesses that go wrong go wrong quietly. A German-locale Excel reads
1,5 as one-and-a-half and 1.5 as a date. A product code of
007 becomes the number 7 and the leading zeros are not recoverable. Anything shaped
like 1-2 or MAR1 can become a date. None of that is announced.
Writing the workbook directly means the type of each cell is decided here, once, by rules you can read on this page rather than by whichever machine opens the file. It also means the sheet arrives usable: header frozen, autofilter on, columns wide enough to read.
How a cell gets its type
With detect numbers & booleans on — the default — a cell becomes a number only when the
text is a plain decimal with no leading zero, no thousands separators, no currency symbol and no
surrounding spaces: 42, -3.5, 0.75. true and
false in any casing become booleans. Everything else stays text, deliberately:
007stays text, because the zeros are the data. This is the single most common way a spreadsheet quietly corrupts an export, and it is the reason this rule is written the strict way round.1,234.50stays text, because a comma means one thing in one locale and the opposite in another. Strip the separators upstream if you want it numeric.- Dates stay text. An ISO date in a text cell still sorts correctly and still reads correctly everywhere. Converted to an Excel serial number it would display according to the opener's locale, which is how a European sees the American dates and vice versa.
Choose everything as text when the file is going to a system that re-parses it, or when a column of identifiers must survive untouched no matter what.
What becomes a row
The first repeating element in the document — the classic
<rows><row>…</row></rows> shape — becomes the rows of the
sheet, exactly as in XML to CSV. Nested children are dotted
(address.city), attributes are prefixed with @ unless you turn them off,
and a column is created for every field that appears in any row, so a field missing from some rows
leaves blanks rather than shifting the columns.
The sheet is named after that repeating element unless you set a name. Excel caps sheet names at 31 characters and the name is truncated to fit.
Limits worth knowing
- One sheet. One repeating element in, one sheet out. A document with several unrelated tables needs several runs.
- No formulas, no formatting beyond the header. This is a data-transport workbook, not a report.
- Entries are stored, not compressed. An
.xlsxis a ZIP of XML parts and stored entries are perfectly legal ZIP — every spreadsheet application opens one. The file is larger than a compressed equivalent; zip it if you are emailing something huge. - Very large documents are limited by memory, not by an upload cap. Tens of thousands of rows are fine on a normal machine; millions are not.
Privacy
100% client-side. The XML is parsed and the workbook is assembled in your browser; nothing is uploaded. See the privacy policy.