Data tools

Split CSV into parts

Cut a CSV into several smaller files of N data rows each, repeating the header in every part. Quote-aware: a record with a quoted field containing a literal newline stays one record. Runs entirely on your device.

Runs on your device. The file is never uploaded.

Split CSV into parts cuts a file into chunks of rowsPerFile data rows, 1000 by default, repeating the header on top of each. Parts are named stem.part001.csv onward, the counter padded to three digits or more, and each arrives as its own download. A header-only file is refused with the message no data rows after the header.

Input

Options

Questions

How does it decide where to cut?

By a fixed number of data rows, set with rowsPerFile, which defaults to 1000. The header is not counted, so 1000 means a thousand data rows per part plus the header on top. It must be a whole number of 1 or more. There is no way to split at a value change or a byte size here.

Does every part keep the header?

Yes, when hasHeader is on, which is the default. The first row is taken as the header and repeated at the top of every part, so each file opens correctly on its own. Turn hasHeader off and the first row is treated as data, with no header repeated anywhere.

What are the parts called?

Your file name, without the .csv, followed by .partNNN.csv, for example export.part001.csv, export.part002.csv. The counter is padded to at least three digits, more if the part count needs it, so the files sort correctly. They arrive as separate downloads, not as a zip, so you can take only the ones you want.

Will it split a record that spans several lines?

No. A quoted field containing a literal newline is one record and stays in one part. That is because the file is parsed with quote state tracked across the whole text rather than split on line breaks, so no part can begin or end inside a quoted value.

Why did it say there are no data rows?

Because after removing the header there was nothing left to split, or the file was empty to begin with. An empty file gets "file is empty, nothing to split", and a header only file gets "no data rows after the header". Turn hasHeader off if the file genuinely has no header row.

How large a CSV can it split?

There is no built-in limit, but the whole file is parsed into memory and every part is built in memory before you download it, so the peak use is roughly double the input size. Nothing is uploaded. For a file too large for a browser tab, split it with a desktop tool that can stream from disk.

Related Data tools

1→1Reorder / insert CSV columnsReorder (and drop) a CSV's columns by name, and optionally insert one new column with a constant value at a given position. Quote-aware. A record with a quoted field containing a literal newline stays one record.Takes one file1→1Map CSV column namesRename a CSV's header to a new schema ("old=new" pairs), and optionally drop every column that isn't named in the mapping. Column order and data are otherwise untouched. Quote-aware. A record with a quoted field containing a literal newline stays one record.Takes one file1→1Change CSV separatorRe-delimit a CSV (comma, semicolon, tab or pipe), auto-detecting the current separator when not told what it is. Quote-aware. A record with a quoted field containing a literal newline (including in the header) stays one record.Takes one file1→1Transpose CSVSwap a CSV's rows and columns. Column 1 becomes row 1, and so on. A ragged row (fewer cells than the widest row) is padded with empty cells rather than refused. Quote-aware. A record with a quoted field containing a literal newline stays one record, not two.Takes one filen→1Merge CSV filesConcatenate several CSVs with the same header into one file, in the order given. Quote-aware. A record with a quoted field containing a literal newline stays one record.Combines the files you drop1→1Remove duplicate CSV rowsStrip repeated rows from a CSV. Compares whole records, not physical lines, so a quoted field containing a newline is one record and stays one record.Takes one file