SheetPeek

How to open huge CSV files without Excel

8 min readUpdated September 2026
A laptop screen filled with dense rows of tabular data

A two-gigabyte CSV is no longer an exotic file. It is a routine dump from an analytics warehouse, an ad platform, a payment processor or a fleet of sensors. What is still awkward is opening one. Double-click it and your spreadsheet will spin for minutes, refuse the last few million rows, or quietly rewrite your identifiers. This guide explains exactly why that happens and walks through the approaches that do work — streaming parsers, virtualised grids, command-line utilities and deliberate sampling — along with the memory each one actually needs.

Why Excel struggles with a large CSV

Excel was built as a calculation engine, not as a file reader. It does not open a CSV so much as import it: every field becomes a cell object carrying a value, an inferred type, a number format, a style reference and a position in the dependency graph used for recalculation. That per-cell bookkeeping is what makes formulas, conditional formatting and charts possible — and it is also why a 500 MB text file can demand several gigabytes of RAM once it is loaded into a worksheet.

There is also a hard ceiling. A worksheet in the .xlsx era holds at most 1,048,576 rows and 16,384 columns. Hand Excel a CSV with more rows and it loads the first 1,048,576, shows a “File not loaded completely” warning, and stops. The warning is a single modal dialog that is easy to dismiss without reading, and plenty of reports have been built on silently truncated data as a result.

Finally, there is the silent damage. Excel’s type inference rewrites values during import: leading zeros vanish from postal codes and account numbers, long numeric identifiers become scientific notation, and anything that resembles a date is converted into one. The problem is well documented — in 2020 the HUGO Gene Nomenclature Committee renamed several human genes because spreadsheets kept turning symbols such as SEPT1 into dates. Your customer IDs are no safer.

Streaming and virtualisation: the two ideas that fix it

Streaming means the parser never holds the whole file in memory at once. It reads a slice of bytes, splits it on delimiters and line endings, emits the rows it found, and moves on — keeping only a small buffer and whatever the consumer decides to retain. A streaming reader can therefore walk a file larger than available RAM, and it can start producing rows a fraction of a second after you open it instead of after the last byte is parsed.

Virtualisation is the rendering half of the trick. A browser cannot create ten million table rows in the DOM — it would run out of memory long before it finished laying them out. A virtualised grid keeps only the rows currently visible in the viewport (plus a small overscan buffer) as real elements, positions them inside a tall spacer whose height equals the full row count, and swaps their content as you scroll. Scrolling feels native because the browser is only ever drawing forty or fifty rows.

Put the two together and the file size stops being the limiting factor. Parsing happens once, in chunks, ideally on a worker thread so the interface never freezes; rendering happens continuously but always on a tiny slice. Filtering, sorting and aggregation then operate over the parsed arrays rather than over the DOM, which is why a well-built viewer can filter five million rows in well under a second while a spreadsheet is still recalculating.

Browser-based viewers that never upload

Most tools advertised as “online CSV viewers” are upload forms with a preview attached: your file travels to someone else’s server, is parsed there, and is retained for an unspecified period. For a public dataset that is merely wasteful. For a payroll export, a patient list or a customer database it is a data transfer you probably cannot justify to your compliance team.

The browser itself, however, is a capable local runtime. The File API hands a page a reference to a file the user picked without copying it anywhere; the Streams API reads it in slices; Web Workers run the parsing off the main thread; typed arrays give compact storage for numeric columns. A page built on those primitives opens gigabyte files entirely on your machine — and because there is no server component, there is nothing to breach.

SheetPeek is built exactly this way: CSV and TSV stream through a background worker, Excel workbooks and JSON arrays are decoded in memory, and the grid is virtualised. You can load the page, disconnect from the network, and keep filtering, profiling, deduplicating and comparing files. Verify it yourself — open your browser’s network panel while you work and watch it stay empty.

Command-line tools worth knowing

For a quick look, the classics are hard to beat. `head -n 50 data.csv` shows you the header and shape instantly; `wc -l data.csv` counts rows; `tail -n 20` confirms the file was written completely; `cut -d, -f1,7` pulls two columns out of a hundred. None of these load the file into memory, so they are effectively instant regardless of size.

Purpose-built CSV utilities go further because they understand quoting and embedded newlines, which naive `awk` one-liners do not. csvkit (`csvstat`, `csvcut`, `csvgrep`) is the readable Python option; qsv and xsv are Rust tools that are orders of magnitude faster on large files; Miller (`mlr`) handles CSV, TSV and JSON with the same verbs. All of them stream, so memory use stays flat as the file grows.

When you need real queries rather than filters, an embedded analytical database is the right tool. DuckDB reads a CSV directly with `SELECT * FROM read_csv_auto('data.csv')`, infers types, uses every CPU core and spills to disk when a result exceeds memory — you can group and join hundreds of millions of rows on a laptop. `clickhouse local` fills the same niche. Both are single binaries with no server to set up.

Sampling and splitting when you only need a look

Most of the time you do not need all the rows — you need to know the column names, the value ranges, the encoding and whether the export looks sane. A sample answers all of that. `head -n 100000 data.csv > sample.csv` gives you a file any tool can open, and `(head -n 1 data.csv; awk 'NR % 500 == 0' data.csv) > sample.csv` keeps the header while taking every five-hundredth row, which spreads the sample across the whole file instead of the first few minutes of a time-ordered export.

Splitting is the other classic move: `split -l 1000000 data.csv part_` produces million-row chunks. It is genuinely useful when you must hand pieces to a tool with a hard limit, but remember that only the first chunk keeps the header row, and that any analysis spanning the whole dataset — totals, distinct counts, deduplication — becomes wrong if you run it per chunk and never combine the results.

A sample is a diagnostic, not a dataset. Use it to design the real query, then run that query with a tool that sees every row. Decisions about totals, revenue, duplicates or coverage must never come from the first hundred thousand lines of a file.

How much memory a big CSV really needs

The file size on disk is a poor predictor of memory use. Text on disk is compact; parsed data is not. A short numeric field costs a handful of bytes as text but a full 8-byte double plus object overhead once parsed, and every string in a JavaScript or Python runtime carries a header of its own. A realistic rule of thumb is two to ten times the file size in RAM, with the multiplier rising as rows get narrower and values shorter.

Two techniques cut that dramatically. Columnar storage keeps each column in one dense array instead of building a separate object per row, which removes most of the per-object overhead and makes column scans cache-friendly. String interning — storing each distinct value once and referencing it — is close to free for low-cardinality columns such as country, status or category, where a million rows may hold only a few dozen distinct strings.

Know your ceiling, too. A 64-bit browser tab typically has a heap limit in the low single-digit gigabytes regardless of how much RAM the machine has, and hitting it kills the tab rather than slowing it down. If your working set is genuinely larger than that, move to a tool that spills to disk — DuckDB, ClickHouse or a database — rather than fighting the allocator.

A workflow that scales

Start by inspecting, not opening: `head`, `wc -l` and `file` tell you the shape, the row count and the encoding in seconds. Then open the file in a streaming, virtualised viewer to see real values, spot ragged rows, check which columns are actually populated and confirm the delimiter and quoting are what you expected.

Only then decide where the work belongs. Filtering, profiling, deduplicating and comparing two exports are all interactive tasks a local viewer handles well. Repeated joins, aggregations across hundreds of millions of rows, or anything you will need to re-run on a schedule belong in DuckDB or a real database. Keep the raw CSV as the archival original and export derived slices from it — never overwrite the source.

Related toolSheetPeek workspaceOpen a CSV, Excel or JSON file — nothing is uploaded