Developer tools
CSV split online
This CSV split tool cuts one CSV file into smaller CSV files by a set number of data rows, by a number of near-equal parts, or by the values in one column. Each part can repeat the header row. The split runs in your browser, and you save one part or a ZIP of all parts.
Processed in your browser
1. Input CSV
Paste CSV, or open a UTF-8 file.
Auto-detect tries comma, semicolon, tab and pipe. Choose explicitly if the preview looks wrong.
2. Split options
Without repetition, the header stays in the first part only. Header rows do not count toward the split size.
Preparing tool…
Parts
Selected part preview
Scroll within the table to see more columns. With the table focused, use the arrow keys.
Preview shows 25 rows and 8 columns at a time; downloads include every field.
How to split a CSV file into multiple files
- Add CSV and check its delimiter
Paste into CSV text or select Open file. Set Delimiter and First row is a header for your records.
- Set rows, parts or a group column
Choose a Split mode, enter its row count, part count or column number, then select Split CSV.
- Preview and download the parts
Select a part to check its rows. Use Download for that CSV or Download ZIP for every part.
Paste CSV into the CSV text box, or select Open file to read a UTF-8 .csv, .tsv or .txt file. Delimiter starts on Auto-detect, which tries comma, semicolon, tab and pipe, and First row is a header is ticked. Choose the delimiter yourself if the preview looks wrong.
Under Split options, pick a Split mode: Rows per part, Number of parts or Group by column. Type the number in the box below it; the default is 1000 data rows per part.
Select Split CSV. The Results panel lists each part with its row count and a Download button, and Download ZIP saves every part in csv-parts.zip. Select a part to preview it, 25 rows and 8 columns at a time.
Example: the seven-row sample
Use example loads a CSV with the header id, team, note and 7 data rows, and splits it at 3 data rows per part. The result is 3 parts: part-0001.csv and part-0002.csv hold 3 rows each, and part-0003.csv holds the last row. Each part starts with the header, so the files hold 4, 4 and 2 records.
The same sample with Number of parts set to 2 gives 4 rows and 3 rows. With Group by column and the column number 2, the team column, it gives group-0001.csv with the 3 North rows, then South with 2 rows and West with 2, in the order each team first appears.
The first note holds a line break inside quotes, and the third holds doubled quotes. Both stay inside one field in the output. The ids 001 to 007 keep their leading zeros, because the tool never converts a value to a number.
Rows per part, number of parts or column values
Rows per part makes consecutive chunks of the size you type, and the last chunk holds what is left. 2,500 data rows at 1000 per part give 3 files of 1,000, 1,000 and 500 rows. The header row does not count toward the size.
Number of parts divides the rows into that many consecutive chunks of near-equal size. When the rows do not divide evenly, the earlier parts get one extra row each, so 7 rows in 3 parts give 3, 2 and 2. Ask for more parts than there are data rows and you get one row per file.
Group by column writes one file for each distinct value in the column you choose, where 1 is the first column. Values must match exactly, so A, a and A with a trailing space make three groups. Rows with an empty field form one group, and rows too short to reach the column form another, shown as Missing cell.
Headers, quotes and the output files
With First row is a header ticked, Repeat header in every part copies the header to the top of each file. Turn it off and only the first part has the header, which suits files that you will join again later. With the header box clear, the first row counts as data and no part gets a header.
The tool splits parsed records, not raw lines, so a quoted field with a line break stays whole in one part. Blank records and rows of uneven width are kept as they are. A byte order mark at the start of the input is removed. A final line ending closes the last record without adding another one. Duplicate header names remain unchanged.
Each part is UTF-8 without a byte order mark. Every field is wrapped in double quotes, records end with CRLF, and the delimiter is the one you chose or the one detected, so a semicolon file gives semicolon parts. Field values are not changed, including text that looks like a formula.
Spreadsheet apps may interpret formulas or numbers when they open a CSV. Import columns as text when you need to keep values such as 001 exactly as written.
Limits
The tool splits by rows, by part count and by the value in one column. It cannot split by file size, split one field into several columns, or keep only the rows that meet a condition. It reads UTF-8 text only: a file in another encoding stops with an error, and so does a quoted field that never closes.
The tool sets no cap on rows or file size. In a Node check of the same code, 2,500,000 data rows split into parts of 1,000,000, 1,000,000 and 500,000 rows. In the browser, the memory and text length limits of your browser set the size you can split, and a run past them stops with an error. Cancel stops a long run and keeps your input and options.
Download ZIP writes an uncompressed ZIP, which must stay under 4 GiB and hold fewer than 65,535 files. When a ZIP is too large, download the parts one at a time.
Questions
How do I split a CSV file into two?
Choose Number of parts in Split mode, type 2 and select Split CSV. The data rows are divided into two consecutive halves, and with an odd count the first part holds one extra row. With Repeat header in every part ticked, both files start with the header row. Select Download ZIP to save both files at once.
How do I split one CSV file into multiple files?
Leave Split mode on Rows per part and type how many data rows each file should hold, such as 1000. Select Split CSV, then Download ZIP. The files are named part-0001.csv, part-0002.csv and so on, in the order of the original rows, and the last file holds the rows that are left over.
Can a CSV file hold 2 million rows?
Yes. The CSV format has no row limit, but an Excel sheet holds at most 1,048,576 rows, so Excel cannot show all rows of a larger file. Set Rows per part to 1,000,000 or less, and each part fits on one sheet. This tool sets no row cap of its own; browser memory is the limit.
How do I split a CSV by the values in one column?
Choose Group by column and type the column number, where 1 is the first column. Select Split CSV. Each distinct value gets its own file, named group-0001.csv and so on, and the part list shows the value that each file holds. Rows keep their original order inside each group, and groups follow the order in which each value first appears.
Does every part keep the header row?
Yes, by default. Repeat header in every part is ticked, so each file starts with the header and opens with its column names. Clear it to keep the header in the first part only. The header row never counts toward the part size, so 1000 rows per part means 1000 data rows plus the header.
Which delimiter do the split files use?
The same one as the input. Auto-detect tries comma, semicolon, tab and pipe on the first 10 records, and every part keeps the delimiter it finds. If the preview shows all fields in one column, choose the delimiter from the Delimiter list and select Split CSV again. Tab input gives tab-separated parts with the .csv name.
Is my CSV uploaded?
No. The file is read, split and zipped by a worker in your browser, and nothing is uploaded or stored. The parts stay in the memory of this page until you download them. Reset clears the input and the results, and leaving the page clears them too.