CSV Splitter

Split a large CSV file into smaller files by row count, number of files, or file size. Each part keeps the header, quoted fields stay whole, and nothing leaves your browser.

Files are processed locally in your browser and never uploaded.

Files are processed locally in your browser and never uploaded.

How the splitter works

The file is read as a stream of bytes and cut only at row boundaries, so every output file is valid CSV on its own.

  1. 1

    Find where each row ends

    The bytes are scanned once. A newline ends a row only when it is outside double quotes, so a line break inside a quoted field, like a multi-line address, never splits a row in two.

  2. 2

    Cut at row boundaries

    By rows: every N data rows start a new file. By file count: the total row count is taken first, then rows are dealt out as evenly as possible. By size: rows are added until the next row would exceed the limit.

  3. 3

    Assemble each part

    Each output file is the original header bytes plus a byte range of the original file. Nothing is decoded, re-encoded, or copied, which is why a multi-gigabyte file splits in seconds without exhausting memory.

What is preserved and what is not supported

  • Rows are never split, even when a single row is larger than the size limit; that row becomes its own file.
  • Quoted fields follow RFC 4180: commas, line breaks, and doubled quotes ("") inside quotes are data.
  • The delimiter (comma, semicolon, tab, or pipe) is detected from the first row and can be overridden. It affects how quotes are interpreted and the preview, not where rows end.
  • A UTF-8 byte-order mark and Windows CRLF line endings are kept on every part, so Excel opens the pieces exactly like the original.
  • UTF-16 files are rejected with a message; save them as UTF-8 first. At most 5,000 output files are created in one run.
  • The ZIP download uses the store method (no compression) and is limited to 4 GB total; larger results can still be downloaded file by file.

Worked examples

Both examples use the built-in samples, so you can load them and check every number.

Split 12,000 order rows into files of 5,000 rows

Load the "Orders (12,000 rows)" sample, keep "Rows per file", enter 5000, and leave the header switch on.

  1. 1The first line "order_id,order_date,…" is the header. The remaining 12,000 lines are data rows.
  2. 212,000 ÷ 5,000 = 2 full files with 2,000 rows left over, so three files are produced.
  3. 3Files 1 and 2 hold rows 1–5,000 and 5,001–10,000. File 3 holds rows 10,001–12,000.
  4. 4Each file starts with the same header line, so each has 5,001, 5,001, and 2,001 lines respectively.

Result: orders-2026_part_01.csv (5,000 rows), orders-2026_part_02.csv (5,000 rows), orders-2026_part_03.csv (2,000 rows). Together they contain exactly the 12,000 original rows.

Split 600 support tickets with multi-line notes into 4 files

Load the "Tickets with multi-line notes" sample, choose "Number of files", and enter 4.

  1. 1The notes column contains quoted text with commas, doubled quotes, and line breaks. The first pass counts rows while ignoring newlines inside quotes and finds 600 data rows.
  2. 2Rows per file = ceil(600 ÷ 4) = 150.
  3. 3Rows are dealt out in order: tickets T-0001–T-0150, T-0151–T-0300, T-0301–T-0450, T-0451–T-0600.
  4. 4A ticket whose note spans three lines still lands in one file, because the cut happens only at row ends outside quotes.

Result: four files of 150 tickets each. Open any part in a spreadsheet and the multi-line notes are still a single cell.

FAQ

Questions about how this CSV splitter handles files, headers, and encodings.

Is my CSV uploaded to a server?

No. The file is read with the browser's File API and split into byte ranges on your device. There is no upload, and closing the tab discards everything.

How large a CSV file can I split?

The file is streamed, so the size of the file does not matter for memory; files above 1 GB split fine. The practical limit is the ZIP download, which is capped at 4 GB. Larger results can be downloaded one file at a time.

Does each output file keep the header row?

Yes, when "First row is a header" is on, the header is repeated at the top of every part. Turn it off if your file has no header, and the first line is treated as data.

What happens to quoted fields with commas or line breaks?

They stay intact. A newline inside double quotes is treated as part of the field, not as the end of a row, and doubled quotes ("") are recognised as escaped quotes.

Which delimiters are supported?

Comma, semicolon, tab, and pipe. The delimiter is detected from the first row, and you can override it if the detection is wrong.

Will Excel open the split files correctly?

Yes. If the original file has a UTF-8 byte-order mark or Windows line endings, every part keeps them, so Excel reads the pieces the same way it read the original.

Should I split by rows or by file size?

Split by rows when the target has a row limit, for example Excel's 1,048,576 rows per sheet or an import tool that accepts 10,000 rows at a time. Split by size when the target has an upload limit in megabytes. Split by number of files when you want equal chunks for parallel processing.

How do I merge the pieces back into one file?

Concatenate them and drop the repeated header lines. On macOS or Linux: head -n 1 part_01.csv > all.csv; tail -n +2 -q part_*.csv >> all.csv. In Python, pandas.concat over the parts does the same.