How to Split a Large CSV File Into Smaller Files
Splitting a CSV sounds trivial, cut it into pieces, until you realize the header row needs to survive in every piece, and whoever gets the split files needs to know how to put them back together. Here's how to do it without losing that context.
Why Split a File At All
- A downstream tool has a size or row limit (some import tools cap at a fixed row count)
- You need to distribute work across a team, or process chunks in parallel
- You only need a subset and splitting by category or date is a fast way to extract just that slice
- A tool is choking on the full file size, and splitting is a pragmatic workaround (see our guide on working with large CSV files)
Three Common Splitting Strategies
By fixed row count
Split into equal-sized chunks (e.g. 100,000 rows each). Simplest option, best when you just need to reduce file size and don't care how the data is grouped.
By a category column
One output file per distinct value in a column (e.g. one file per region, or per product category). Useful when different files need to go to different teams or systems.
By date range
One file per month, quarter, or year. The natural choice for time-series data that's typically consumed one period at a time anyway.
The Rule That Matters: Keep the Header in Every File
The single most common mistake when splitting a CSV: only the first output file gets the header row, the rest are headerless. Any tool or person receiving files 2 through N will misinterpret the first data row as headers, or fail to load the file at all. Every split file needs its own copy of the original header row.
Naming Files So They Can Be Recombined
Use a naming convention that encodes what's inside without opening the file: customers_part-01-of-12.csv, or sales_2024-01.csv for a date-based split. This matters more than it seems, six months later, "export_final_v2.csv" tells nobody anything, and someone will have to open every file to figure out which is which.
Recombining Later
If you'll need to merge the split files back into one later, splitting by row count (not by category) keeps that trivial, concatenate the files, drop the duplicate header rows. Splitting by category makes recombination easy too, but reconstructing the original row order requires the files to still carry a sortable column (like an ID or timestamp).
Doing This in How To CSV
The Batch Processor and Compress tools handle large-file workflows including splitting, with the header preserved automatically in every output file, all processed in your browser.
Turn this into a saved workflow
Create a free account to save the steps from this guide as a reusable workflow and re-run it on any file, from any device.