Count rows in a CSV file online, without opening it
Any size. Free, no upload, no account.
Count the rows in a CSV file
Drop it here or choose a file. CSV, TSV or TXT, any size. Millions of lines are fine.
The sample is 1,000,000 hourly readings of made-up UK weather, made on your device.
Your file never leaves your device. It is read by your browser, on your device. Nothing is uploaded.
How to count rows in a CSV file
- Choose your file. Drop a CSV, TSV or TXT file onto the counter, or pick it with “Choose a file”. Any size works, including files far too big for Excel. No file to hand? “Try it with sample data” counts 1,000,000 rows of made-up UK weather, made on your device.
- Let it count. Your browser counts every line, right on your device. A progress bar shows how far it has got, and you can cancel at any time.
- Read the result. You get the number of lines, the delimiter, the number of columns in the first line, the file size and the time taken. Subtract one for the header line to get the number of data rows, unless some values contain line breaks (see “Rows vs lines” below).


Rows vs lines: why counts can differ
The counter counts lines: every line break starts a new line, Windows (CRLF) and macOS or Linux (LF) line endings count once each, and a last line without a line break after it still counts. For most CSV files lines and rows are the same, apart from these cases:
- The header row. The line of column names is a line too. A file with 1,001 lines and a header holds 1,000 data rows.
- Blank lines. Empty lines count as lines, which matters when an export ends with a few of them. A data row never counts them.
- Quoted values with line breaks. A value in double quotes may contain line breaks, such as a multi-line address or comment. That row spans two or more lines, so the line count is higher than the number of rows.
- The newline at the end. A file that ends with a line break and one that does not give the same count here. Command-line tools such as
wc -lcount line breaks instead, so they report one less when the last line has none.
Here is a small example. The counter reports 4 lines, but the file holds a header and only 2 data rows, because Bob’s comment spans two lines:
id,name,comment
1,Alice,"Called on Monday"
2,Bob,"Line one
line two"Need the exact number of data rows? Open the file in the large CSV viewer: it reads quoted line breaks as part of the value, skips blank lines and the header, and shows the number of rows above the table. Very old Mac files that use a bare carriage return (CR) as the line break are rare today; the counter reports them as a single line, and the viewer reads them correctly.
Built for very large files
The counter is built for files far bigger than spreadsheets can open. Memory use stays low however big the file is, the page stays responsive while it counts, and you can cancel at any time.
In our tests on a recent laptop, a 10-million-line CSV of just over 400 MB is counted in about 0.6 seconds. Speed depends mostly on your disk and browser, so slower machines take longer, but there is no upload to wait for and no size limit to hit. If your file is too big for Excel, our guide on how to open a CSV file that’s too big for Excel walks through what to do next.
Other ways to count rows in a CSV
If you prefer the command line or need to count rows in a script, these work well:
macOS and Linux: wc -l
wc -l data.csvFast and built in. wc counts line-break characters, so it reports one less than the real number when the last line has no trailing line break.
Windows: PowerShell or Command Prompt
# PowerShell: streams the file, so it copes with big files (use the full path)
[Linq.Enumerable]::Count([IO.File]::ReadLines("C:\data\data.csv"))
# Command Prompt
find /c /v "" data.csv(Get-Content data.csv).Count also works, but it reads the whole file into memory first, which gets slow beyond a few hundred megabytes.
Python
# Lines, like the counter above
with open("data.csv", "rb") as f:
lines = sum(1 for _ in f)
# Records (handles quoted line breaks), header excluded
import pandas as pd
records = sum(len(chunk) for chunk in pd.read_csv("data.csv", chunksize=1_000_000))Reading in chunks keeps pandas from loading a huge file into memory all at once. A plain len(pd.read_csv("data.csv")) is fine for smaller files.
Excel
Open the file and press Ctrl+End to jump to the last used row. This only works up to Excel’s limit: if the last row is 1,048,576, the file was almost certainly cut off and holds more rows than Excel shows.
Frequently asked questions
How do I count rows in a CSV file without opening it?
Use a line counter instead of a spreadsheet. The row counter on this page reads the file in your browser without opening it in a grid or uploading it, so it works for files of any size. On the command line, wc -l (macOS and Linux) or find /c /v "" (Windows) do the same job.
Is the CSV row counter free?
Yes. Counting the lines of a CSV, TSV or TXT file, and so its rows, is free.
Do I need an account to count rows?
No. A row count needs no account or email address. An account adds workspaces, which the counter does not use.
Is there a maximum number of rows in a CSV file?
No. CSV is plain text, so the format itself has no row limit. The limits come from the programs that open it: an Excel worksheet holds up to 1,048,576 rows, and a Google Sheets spreadsheet up to 20 million cells (Google’s help page, checked 10 October 2026).
Why is the line count one higher than the number of records?
Because the header line is counted too. A file with a header line and 1,000 records has 1,001 lines. Blank lines and values with line breaks inside quotes make the difference larger. For the exact number of records, open the file in the large CSV viewer, which reads quoted line breaks and skips blank lines.
Is my file uploaded?
No. The file is read by your browser on your own device and is never sent anywhere. You can confirm this in the Network tab of your browser’s developer tools.
Does it work with TSV, TXT and semicolon-separated files?
Yes. It counts the lines in any plain-text file and detects comma, semicolon, tab and pipe delimiters to report the number of columns in the first line. Compressed files such as .zip or .gz need to be extracted first.
How fast is it?
In our tests on a recent laptop, a 10-million-line CSV of just over 400 MB takes about 0.6 seconds. Speed depends mostly on your disk and browser, so slower machines take longer.
Can I count rows in an Excel (.xlsx) file?
Not yet. The counter reads text-based files such as CSV, TSV and TXT. Excel (.xlsx) support is coming soon. In the meantime, Excel itself shows the last row number when you press Ctrl+End, up to its limit of 1,048,576 rows.
Related tools and guides
- Split CSV filesCut a big CSV into files Excel can open
- Large CSV viewerScroll every row of a CSV too big for Excel
- Merge CSV filesCombine many CSVs, even if the columns differ
- CSV too large for Excel?Open every row past Excel’s 1,048,576 limit
- CSV statisticsMean, std dev, min and max of any column
- CSV plotterPlot CSV, Excel, MATLAB, Parquet and TDMS files
MegaRows processes files locally in your browser. Read our privacy statement for details.