Split a CSV into several files

Drop a CSV here

or paste it below — .csv, .tsv, .txt

Split options

Break a large CSV into smaller files by rows per file, by how many files you want, or by the value in a column so each group gets its own file. The split happens at record boundaries rather than line boundaries, so a record containing a line break inside a quoted field is never cut in half. Every piece keeps the header row, and the whole set downloads as a ZIP. Nothing is uploaded.

How to split a CSV

  1. Drop the .csv into the box above, or paste it in. Nothing is uploaded.
  2. Choose how to split it: rows per file, a number of files to divide it into, or a column's value to get one file per group.
  3. Leave the header repeated unless the pieces are going to be joined back together.
  4. Press Split, check the list and the report, then download the ZIP.

Records, not lines

A CSV splitter looks trivial: count lines, cut every thousand, paste the header on the front of each piece. That works until a file contains a record with a line break inside a quoted field — a shipping address, a comment, anything pasted out of a document. Such a record occupies several lines, and a line-counting splitter will eventually put its boundary in the middle of one.

The result is two broken files. The first ends with an open quote, so a parser reading it treats everything after that point as one enormous field. The second starts halfway through somebody's address, so its first row has the wrong number of columns and every value lands under the wrong header. No error is raised by anything, at any stage.

This tool parses the whole file into records before it splits anything, so a boundary can only fall between two records. After the split it tells you how many line breaks were sitting inside quoted fields, and shows the file's text-line count next to its record count. When those two numbers differ, you are looking at a file a line-based splitter would have damaged.

Three ways to split, and when each is right

Split byUse it whenResult
Rows per file Something downstream has a row limit — an import form, a bulk upload, an API batch size Equal pieces of the size you named, with a smaller remainder at the end
Number of files You are dividing work between people or processes The row count spread evenly across exactly that many files
A column's value The file is really several datasets in one — per region, per month, per client One file per distinct value, each named after it

Splitting by a column

This is the mode most people are looking for and the one most splitters do not offer. Pick a column and every distinct value in it becomes its own file, named after the value: sales-north.csv, sales-south.csv. Each keeps the header, so each opens on its own.

Two details are worth knowing. Values are grouped exactly as they appear, so North and north are different groups — the tool does not guess that they mean the same thing, because sometimes they do not. And because those two would produce the same filename once cleaned up, a number is added to the second rather than one file quietly overwriting the other. The list of files and their row counts is shown before you download, which is the quickest way to notice that the column you picked was not the one you meant.

Size, memory and the ZIP

Nothing is uploaded, so there is no server-side file size limit to argue with. What limits you is your own machine's memory, since the file is parsed in the browser tab. A few hundred megabytes is usually comfortable on a desktop and much less on a phone; if memory runs out the tab stalls rather than producing a quietly wrong answer.

The pieces come down as one ZIP, built in the browser. CSV is plain text, so it compresses hard — the ZIP is typically a small fraction of the original. A split that produces a single piece downloads as a plain .csv instead, because zipping one file helps nobody.

Next steps

If what you actually need is the data in another shape, CSV to JSON converts it and reports anything it had to change along the way, and JSON to CSV goes back the other direction.

Frequently asked questions

Why does splitting by lines break a CSV?

Because a CSV record is not the same thing as a text line. A field wrapped in quotes may contain line breaks - addresses and comment fields routinely do - and that record then occupies several lines in the file. A splitter that counts lines will eventually cut one of those records in two, leaving a file that ends mid-quote and a next file that starts mid-sentence. Neither is valid CSV and nothing warns you. This tool parses the file into records first, so a boundary can only fall between records. The page tells you how many multi-line records it found.

Does each file get the header row?

Yes, by default, and it is the right default: every piece is then a valid CSV that opens on its own. You can switch it off if the files are going to be concatenated back together or fed to something that supplies its own header.

Can I split by the value in a column?

Yes, and it is usually what people actually want. Choose a column and you get one file per distinct value - one per region, per month, per customer - each named after the value and each with the header. The page lists every group and its row count before you download, so you can see whether the column you picked was the one you meant.

How large a file can it handle?

There is no upload, so there is no server-side size cap. The limit is your own machine's memory, because the file is parsed in the tab. A file of a few hundred megabytes is usually fine on a desktop; on a phone, expect much less. If the browser runs out of memory the tab will stall rather than produce a wrong answer.

What do the output files get called?

The original name with a suffix - sales.csv becomes sales-1.csv, sales-2.csv and so on when splitting by size, or sales-north.csv and sales-south.csv when splitting by a column. Values that cannot go in a filename are replaced, and if two different values would collide after cleaning, a number is added so nothing overwrites anything.

How are the files delivered?

As a single ZIP, built in your browser. CSV is plain text and compresses very well, so the ZIP is usually a small fraction of the original. If you asked for only one piece, it downloads as a plain CSV instead.

Is the delimiter preserved?

The file is read with the delimiter it was written with - comma, semicolon, tab or pipe, detected automatically - and each piece is written back out with the same one, so the output matches the input. Quoting is applied where a value needs it, which may differ slightly from the original if the source quoted more fields than it had to.