Count the rows in a CSV file

It sounds trivial — until you need the real answer. Line-counting tricks (Notepad++’s line number, wc -l, PowerShell’s Measure-Object -Line) count lines, and CSV rows aren’t lines: a quoted field can legally contain line breaks, so one row can span five lines, and a count that’s off by “only” a few hundred can mean a batch job silently dropped records. This counter parses the file properly — quote-aware, header excluded — and shows the true row count the moment the file loads.

It handles the big ones, too: multi-GB exports are indexed in a streaming pass, so you get an exact count without opening the file in anything heavyweight or waiting for Excel to truncate it at a million rows.

Drop a CSV, TSV or Excel file here

.csv · .tsv · .txt · .csv.gz · .xlsx — files up to 4 GB open here, in your browser. Nothing is uploaded; the file is read in place on your device.

Paste rows

Paste CSV text or cells copied from Excel / Google Sheets (they paste as tab-separated).

How it works

  1. Drop the file — the exact data-row count appears in the status bar as soon as indexing finishes.
  2. Toggle “First row is header” if your file has none — the count updates.
  3. Optionally filter, then read the matching-rows count next to the total.
  4. Column stats (Stats panel) additionally count empty cells and distinct values per column.

Why line counts lie about CSVs

RFC 4180 — the closest thing CSV has to a standard — allows line breaks inside quoted fields. Address fields, comment columns and product descriptions use that constantly. Every line-based counter (wc, text editors, log tools) splits on newlines regardless of quotes, so each multi-line field inflates the count; conversely, a file whose last line lacks a trailing newline gets undercounted by tools that count newline characters. Blank lines are the third trap: most parsers (this one included) skip fully blank lines, while line counters include them.

A parser-based count is also a quick integrity check: if the source system says it exported 1,048,901 records and the parsed count says 1,048,576, something in the middle used Excel — that’s exactly its row limit, and your file was truncated in transit.

Good to know

Frequently asked questions

Does the count include the header?

No — when “First row is header” is on (auto-detected), the status bar counts data rows only. Toggle it off for headerless files and the first row counts as data.

Why does this count differ from wc -l or my editor?

Three usual causes: quoted fields containing line breaks (one row, several lines), a missing final newline (undercounted by newline-counters), and blank lines (counted as lines, but not rows). A quote-aware parse is the count that matches what a real importer will load.

How long does counting a huge file take?

It’s one streaming pass — roughly as fast as your disk can read the file. A 1 GB CSV takes a few seconds on a laptop SSD; you’ll see a progress bar while it indexes.