Working with big CSV files in and out of Excel
CSV is the format every system can export, and Excel is where most of those exports end up. The trouble starts with size and with Excel's habit of guessing: a file over a million rows is cut off, and ZIP codes, account numbers and product codes are rewritten the moment the file opens. Here is what goes wrong and how to work around it.
By Radhika Singh · Last updated
The limits you hit first
Spreadsheets have hard caps, and the numbers are worth knowing before you open a big export.
| Application | Limit | What happens past it |
|---|---|---|
| Excel (2007 and later) | 1,048,576 rows × 16,384 columns per worksheet | Opening a bigger CSV loads only the first 1,048,576 rows, after a warning |
| Google Sheets | 10 million cells per spreadsheet | The import fails |
For a quick look without Excel's guessing, the CSV Viewer opens files up to 50 MB and a million rows in the browser and shows every value exactly as written, ZIP codes and long IDs included. For anything bigger, or to work with it in Excel, split it first.
Splitting a file that is too big
CSV Splitter cuts a file into parts by rows per file, by number of files, by size, or by the values of a column, so you can get one file per state or per month. Repeat the header in every part so each file opens with its column names. A split at 1,000,000 rows leaves room under Excel's limit for the header and later additions.
What Excel changes when it opens a CSV
Double-clicking a CSV lets Excel guess each column's type. The guesses that cause real damage:
- Leading zeros disappear: ZIP code 02139 becomes 2139, and product codes such as 00731 lose their zeros.
- Long numbers are cut to 15 significant digits and shown in scientific notation: a 16-digit card or account number ends in 0 forever once the file is saved.
- Text that looks like a date becomes one: 3-4 turns into March 4, and gene names such as SEPT2 and MARCH1 were converted so often that scientists renamed the genes in 2020.
- Accents garble (é instead of é) when a UTF-8 file without a byte-order mark opens in an older Windows Excel.
- In locales that use a comma as the decimal separator, Excel expects semicolons between fields, so a comma-separated file opens as a single column.
The fix is to stop Excel guessing. Import through Data > From Text/CSV and set problem columns to Text, or convert the file to a real workbook first: CSV to Excel writes an .xlsx that keeps leading zeros, turns real dates into Excel dates and adds a bold, frozen header with filter buttons. Once data is in .xlsx with the right types, Excel leaves it alone.
Combining exports
Monthly exports, one file per store, the same report from three regions: CSV Merger stacks files with the same columns into one, matching columns by name even when they are in a different order, and can add a source_file column so every row says where it came from. It can also join two files on a key column, a VLOOKUP across files without opening either in Excel, and remove duplicate rows in the result.
Tabs, semicolons and quotes
Not every "CSV" uses commas. Database exports and copy-paste from spreadsheets are often tab-separated, and European systems often use semicolons. TSV to CSV converts tab-separated data to commas (or semicolons, or pipes) and quotes fields correctly, so a value like "Austin, TX" stays one field. Quoting is the rule that matters: a field containing the delimiter, a quote or a line break must be wrapped in double quotes, with inner quotes doubled.
When the data has outgrown a spreadsheet
Past a few million rows, a database is the better tool. CSV to SQL writes a CREATE TABLE statement and batched INSERTs for PostgreSQL, MySQL, SQLite or SQL Server, with column types inferred from the data and empty cells as NULL. Excel's own Data Model (Power Pivot) also holds far more rows than a worksheet when you only need pivot tables. For the other direction, putting a small extract into documentation or a pull request, CSV to Markdown turns rows into a Markdown table.
A safe routine for big exports
Before sharing or editing a large export:
- Check the row count and the delimiter before opening it anywhere.
- Over a million rows: split it, repeating the header.
- Columns with ZIP codes, IDs or codes: convert to .xlsx or import them as Text.
- Several exports of the same report: merge them with a source column.
- Never save over the original CSV from Excel; keep the raw export untouched.