Max Rows in CSV: Where the Limit Really Comes From
CSV files have no built-in row maximum. Learn where row limits come from, how spreadsheets truncate large files, and how to keep data intact when converting CSV and TSV.
Short answer: the CSV format has no row maximum
A CSV file is plain text. Each record is a line, or several lines when a quoted field contains a line break, and fields are separated by commas. The format itself sets no maximum row count, and the commonly cited CSV specification does not define one. A CSV file can hold as many rows as your storage, file system and tools can handle. When people hit a row limit, the limit almost always belongs to the program that opens, imports or converts the file, not to CSV.
Is CSV suitable for your data volume?
For moving large tabular data between systems, CSV is usually a sound choice. Its main benefit is that nearly every database, scripting language and spreadsheet can read it, and there is no row ceiling in the format. The decisive tradeoff is that CSV carries no data types, no schema and no guarantee that the receiving tool will load every row. A file that is perfectly valid can still be cut short the moment someone opens it in a spreadsheet.
Keeping the data as raw CSV or TSV is the better option when the row count exceeds what your spreadsheet can display, when the file will be processed by scripts or a database, or when you need an exact, lossless copy for archiving or exchange. Converting it into a spreadsheet workbook makes sense only when the data fits within that application's limits and people need to view or edit it interactively.
Where row limits actually come from
| Layer | Type of limit | What happens when you exceed it |
| CSV format | None defined | Not applicable |
| Spreadsheet application | Fixed maximum rows per sheet, or a total cell cap in some online spreadsheets | Rows beyond the limit are not loaded; a warning may or may not appear |
| Import or conversion tool | Tool-specific row, file-size or field-size limits | The import fails, or the output is truncated or split |
| Memory and hardware | Depends on available RAM and how the tool reads the file | Slowdowns, crashes, or the file refusing to open |
| File system and storage | Maximum file size and free space | The file cannot be written or copied in full |
The figure most people mean when they ask about the maximum number of rows in a CSV file is the Microsoft Excel worksheet limit of 1,048,576 rows, which has been documented since Excel 2007. That number is a property of an Excel sheet, not of the CSV file. Other spreadsheet programs set their own limits, and some online spreadsheets cap total cells rather than rows, so wide files reach the limit sooner. Limits change between versions, so check the current documentation for the exact program and version you use. This article does not include test results for specific applications.
What opening or converting a CSV actually changes
Converting CSV to TSV, or the reverse, should change only the delimiter and possibly the quoting rules. The number of records should stay the same. Opening a CSV in a spreadsheet is a different operation: the program parses the text into cells, applies its own row cap, and may reinterpret values. Common reinterpretations include stripping leading zeros from codes, turning number-like strings into dates, and rounding long numeric IDs. None of this changes the file on disk until you save. If you save after a truncated load, though, the missing rows are gone from that copy.
Row counts can also be misread. A line count and a record count are not the same thing when quoted fields contain line breaks. In the example below, a line-counting tool reports four lines, but the file holds one header row and two data records.
id,note
1,"first line
second line"
2,plain
Count records with a CSV-aware parser rather than by counting lines. For example, in Python:
import csv
with open("data.csv", newline="", encoding="utf-8") as f:
rows = sum(1 for _ in csv.reader(f))
print(rows) # includes the header row
Keep in mind that the header row occupies one of the spreadsheet's rows. A file can therefore overflow a sheet even when its data-record count sits exactly at the published limit.
Will the data stay intact after sharing or copying?
The raw CSV text survives copying, emailing and uploading unchanged, as long as the encoding and line endings are preserved. The risk shows up when a recipient opens the file in a program that cannot hold all the rows and then re-saves it. Pasting a very large CSV into a spreadsheet through the clipboard is subject to the same sheet limits, and it may run into clipboard or memory constraints as well. Behavior differs between applications and versions, so do not assume that a file that opened fully in one environment will open fully in another.
Very large files are also hard for people to use directly. Text editors may open them slowly or refuse to, search becomes sluggish, and screen-reader users find it difficult to navigate a huge grid. When people need to read the data, share a filtered or summarized extract alongside the full CSV. Provide the complete file as the source of record.
Practical options when a CSV exceeds your tool's limit
- Split the file into several smaller CSVs, repeating the header row in each part.
- Load the data into a database and query only the rows you need.
- Use a scripting language that reads the file in chunks instead of loading it all at once.
- Use a spreadsheet's data import or data-model features, where available, instead of opening the file directly into a sheet. Check that program's documentation for its own limits.
- After any conversion or split, compare record counts between the source and the output with a CSV-aware parser.
Gaps in this overview
No tested measurements were available for specific tools, file sizes or memory thresholds. Apart from the long-documented Excel sheet limit, this article does not give exact figures for other applications. Confirm the current limits for your software and version in its official documentation, and run a scoped test with a representative file before relying on any tool for large-scale conversion.