How to open large CSV files Excel can't handle
Excel caps a sheet at 1,048,576 rows. Open a bigger file and it drops the rest, often without a clear warning. That’s worse than an error, because your numbers look fine and they’re wrong. Here’s how to work with files past that limit.
First, make sure you’re seeing every row
If a file opens in a spreadsheet and ends at exactly 1,048,576 rows, it was cut off. Check the count against the source before you conclude anything.
No row count from the source? Divide the file size by a typical row length. If you land in the same ballpark, you’re fine. If not, something got cut.
SELECT COUNT(*) AS row_count FROM orders;Why a columnar engine copes better
A spreadsheet keeps every cell in memory along with its formatting and formula state. That’s why memory use shoots up on big files. DuckDB stores each column as a typed array and only reads the columns your query uses.
Select three columns from a fifty-column file and the other forty-seven barely cost anything. Aggregations run in a fraction of the memory.
Aggregate, don’t scroll
Nobody reads a million rows. You open a big file to shrink it: a total, a distribution, or a filtered slice small enough to look at.
Do that in the query instead of scrolling, and file size stops being a problem.
SELECT
DATE_TRUNC('month', order_date) AS month,
COUNT(*) AS orders,
SUM(revenue) AS revenue
FROM orders
GROUP BY month
ORDER BY month;Profile before you trust the numbers
Big files usually come out of an export pipeline, and pipelines leave junk behind: nulls, a header row repeated halfway down, dates in two formats. Check null counts, distinct values, and min and max for each column first. It takes a minute and keeps a bad total out of your report.
How big is too big?
In NoEgress, large CSVs stream from disk into DuckDB instead of loading into page memory, so there’s no fixed row limit. In our tests a 25-million-row, 1.7 GB file loads in under half a minute. Your laptop sets the limit, not an upload quota.
If you outgrow the browser, desktop DuckDB runs the same SQL. Every query in this guide works there unchanged.
Frequently asked
What is Excel's maximum row count?
1,048,576 rows and 16,384 columns per sheet. Anything past that gets cut off when you open the file.
How large a CSV can I open in the browser?
CSVs have no fixed row limit, because they stream into DuckDB from disk. Files over a gigabyte work on a normal laptop. Your machine’s memory is the real ceiling.
Is it faster than opening the file in a spreadsheet?
For filtering and aggregating, by a lot. DuckDB only reads the columns a query needs. A spreadsheet loads every cell.
More guides
NoEgress vs Excel, Power Query, ChatGPT and DuckDB
How to use ChatGPT-style AI on sensitive spreadsheets without uploading them
An Excel alternative for files with millions of rows
How to query a CSV file with SQL
How to run SQL on an Excel spreadsheet
How to analyze confidential data without uploading it
How to check if a website uploads your file
How to compare two CSV files and find what changed
Data quality checks to run before trusting a dataset
How to query a JSON file with SQL
DuckDB online: run DuckDB in your browser with nothing to install
How to ask a local AI model about your CSV or Excel data
How to remove duplicate rows from a CSV or Excel file
How to split a CSV or Excel file into multiple files by column