File tools · CSV
Split a CSV file by rows, size or column value.
Cut a big CSV into pieces that import, email or open. The header row is repeated in every piece, and quoted cells with line breaks are never cut in half.
Pick one of four modes: rows per file, number of files, maximum size, or one file per value in a column. Download each piece or all of them as one ZIP.
The four ways to split
Rows per file makes pieces of N data rows; the last piece holds the remainder. Number of files divides the rows as evenly as possible, so 10 rows in 3 files gives 4, 3 and 3. Maximum size fills each piece up to the limit you set, counting the header and the UTF-8 bytes of every record as it will be written; a single record bigger than the limit still gets its own piece, because a record cannot be divided without breaking it. Column value writes one file per distinct value, for example one file per country or per sales rep, keeping the original row order inside each.
Splitting is done on parsed records, not on text lines. That matters because a command like split -l counts line breaks, and a quoted cell that contains a line break (a multi-line address, a note field) would be cut in two, leaving both halves malformed.
Your file stays on your device
The file is parsed and cut in this tab; the ZIP is built in memory and handed to your browser as an ordinary download. The frame the tool runs in is sandboxed with a policy that allows no network requests, and the zip library (JSZip, used under its MIT licence) is a local script on this site rather than a CDN link.
Worked example
A customer export has 10 data rows and a region column holding A four times, B/x three times and nothing three times. Splitting by that column gives three files: customers-A.csv (4 rows), customers-B_x.csv (3 rows; the slash is replaced because it cannot appear in a file name) and customers-(blank).csv (3 rows with an empty region). Each starts with the original header line. Splitting the same file into 3 equal parts gives 4, 3 and 3 rows instead.
Choosing a size limit
Use a size split when something downstream has a hard cap, for example an upload form with a megabyte limit. Leave a little room: the limit is measured on UTF-8 output, so choosing UTF-16 or adding a byte order mark changes the size slightly. Row limits are the other common cap. Excel opens at most 1,048,576 rows per sheet, so a 3-million-row file needs at least three pieces to be opened there at all.
Common mistakes
- Forgetting the header setting. If the first row is data, untick the header box or the first record will be repeated at the top of every piece.
- Splitting on a column with thousands of values. The tool stops at 2,000 distinct values rather than produce an unusable ZIP. Pick a coarser column, or sort first and split by rows.
- Case and spelling variants.
Ontarioandontarioare different values and get different files. Clean the column first if you need them together. - Assuming the pieces can be re-merged by name. Piece numbers are zero-padded (
-001,-002) so they sort correctly, which makes re-merging in order easy.
What this tool does not do
It does not split by several columns at once, by a pattern, or by date ranges; it does not split Excel workbooks (save a sheet as CSV first); and it does not change cell contents. For Shopify product exports, where variant rows must stay with their product, use the Shopify product CSV splitter.
Frequently asked questions
Is my CSV uploaded when I split it?
No. The file is read and split by JavaScript in your browser tab, in a frame that cannot make network requests. The pieces and the ZIP are created locally.
Will the header row be repeated in every file?
Yes, as long as “First row is a header” is ticked. Untick it for header-less data and no row is repeated.
Does it break rows that contain line breaks inside quotes?
No. The file is parsed into records first, so a quoted cell with an embedded line break stays whole and is written back with its quotes.
How is the maximum size measured?
On the UTF-8 bytes of the output as it will be written, including the header in every piece and your chosen line ending. A single record larger than the limit is kept whole in its own piece.
Can I split by more than one column?
Not directly. Sort or merge the values into one column first, or split by one column and run each piece through the tool again.
Is there a row limit?
The tool sets none; your browser’s memory is the limit. A 100,000-row, 10-column file parses in a fraction of a second in our automated test.
What are the file names?
The original name plus a zero-padded number (sales-001.csv), or the column value for a column split, with characters that are illegal in file names replaced by an underscore.
Sources
- RFC 4180: Common Format and MIME Type for CSV Files (Y. Shafranovich, October 2005) — the record, quoting and line-break rules the parser follows
- Microsoft: Excel specifications and limits — the 1,048,576-row and 16,384-column worksheet size and the 32,767-character cell limit
- WHATWG Encoding Standard — the encoding labels and decoders the browser uses to read text
Check the pieces
Open one piece in the program you will import it into before you process the whole set. The tool splits records faithfully but cannot know your importer’s rules.