mygems

Convert a CSV to Excel

A real .xlsx, with nothing in it changed on the way.

  • Leading zeros survive
  • Long IDs are not rounded
  • Numbers stay summable
  • Nothing uploaded

1.Open the file

CSV or TSV. Drag it here, or choose a file.

Why it exists

Opening a CSV in Excel is not a neutral act. Excel guesses what every cell means, and the guesses are destructive: ZIP codes lose their leading zero, 16-digit order numbers are rounded to 15 digits, and anything that resembles a date becomes one. This writes the .xlsx itself, deciding each column from every value in it, so numbers arrive as numbers you can sum and everything that only looks like a number arrives as the text it was.

What it does

  • Reads every value in each column, not a sample, before deciding whether the column is numeric.
  • Writes numbers as real numbers and true/false as Excel booleans.
  • Keeps any column with leading zeros or more than 15 digits as text, and shows you which ones before you download.
  • Freezes and bolds the header row, adds a filter, and sizes the columns to fit.
  • Splits a file of more than 1,048,576 rows across several sheets of one workbook, since that is Excel's limit per sheet.

Why not just open the CSV in Excel

Because Excel converts on open, and the conversion is the damage. A cell that was `00742` is stored as 742, and saving the file back writes 742. Writing the workbook directly means the type of every cell is decided once, by a rule you can see, rather than by Excel's guess at the moment you double-click.

Questions

Will my leading zeros survive?
Yes. Any column in which a value starts with a zero followed by more digits is written as text, so 00742 stays 00742 in the workbook and in every copy of it.
Why are some of my numbers stored as text?
Because they are identifiers rather than quantities: ZIP codes, phone numbers, account and order numbers. Excel can only hold 15 significant digits, so a 16-digit number would be rounded, and an identifier with its last digit changed is a different identifier. If you would rather have everything as text, tick the box and nothing is converted.
Does it work with very large files?
Yes, up to what the browser tab has memory for. Past 1,048,576 rows the workbook gets a second sheet, and a third, because no single Excel sheet can hold more.