How-to

How to Handle Large CSV Files

Open, edit, and process CSV files that are too big for Excel, without crashing your machine.

Once a CSV passes a few hundred thousand rows, the tools you reach for first start to fail: Excel caps near a million rows and slows to a crawl well before that, and a plain text editor may refuse to open a multi-gigabyte file at all. The trick is to stop trying to load the whole thing at once.

Large CSVs are best handled by streaming (processing a row at a time), by splitting into smaller files, or by loading into a database or a tool built for size. Which you choose depends on whether you need to view, edit, or transform the data.

  1. 1

    Don't open it in Excel

    Excel loads the entire file into memory and caps near 1,048,576 rows. For anything close to that, use a different approach.

  2. 2

    Stream or sample to inspect

    Use a command-line tool (head, tail) or a script to peek at the first rows and understand the structure without loading everything.

  3. 3

    Split or load into a database

    Split the file into manageable chunks, or load it into a database (or DuckDB, pandas, etc.) where you can query without holding it all in a spreadsheet.

  4. 4

    Convert only what you need

    If you ultimately need a subset in Excel, filter or aggregate first, then export just that slice to .xlsx.

Frequently asked questions

How many rows can Excel handle?

About 1,048,576 rows. It truncates beyond that, often silently, and gets slow well before the limit on a typical machine.

What's the fastest way to peek at a huge CSV?

Command-line head and tail, or a streaming viewer, show the start and end without loading the whole file.

Should I convert a giant CSV to Excel?

Only after reducing it. Converting a multi-million-row CSV straight to .xlsx will hit Excel's row cap. Filter or aggregate first.

Compare two spreadsheets

Drop two files into SheetCompare and see every changed cell. Free, private, and runs in your browser.