CSV Split & Merge
Split a CSV into parts by rows, part count or size — header repeated in every part — and merge exports back into one file, entirely on this device.
Parts are numbered to the width of the tally — prefix-1.csv for 9 parts, prefix-001.csv for 300 — so they sort in order. Letters, numbers, dot, dash and underscore only.
Strict needs the same column names in every file. Union keeps every column and writes empty cells where a file has none. By position ignores names and joins columns in order.
Drop one .csv to split, or several at once to merge — the bytes are read in this tab.
—
The parts appear here as you type.
Press ? for shortcuts
Do it offline:$ split -l 1000 -d --additional-suffix=.csv data.csv part-
How to use it
- Paste a table, or drop files — Merge accepts several, and dropping starts no upload.
- For Split, pick the measure: rows per piece, piece count, or a ceiling in kilobytes.
- For Merge, pick how column names are settled: identical, combined, or by position.
- Read the manifest — name, rows, row range, bytes — or the per-file column report.
- Copy or save one piece, or take the set as one .zip.
An export nothing will import is rarely fixed by cutting the file at line 1,000: a value may span two lines, and a piece starting mid-table has lost the heading that named its columns. Split by rows, by piece count, or by a size ceiling, and each piece carries that heading. Merge runs the other way, settling column names first.
How it works
The heading is written again atop every piece. Without it, piece two arrives with its first record read as column names: that record vanishes and the columns take its cells as names. Turn the repeat off and only the opening piece keeps it. The command at the foot of this page does not repeat it either, and counts lines, not records.
Settling column names has three answers. Identical insists every file names the same columns, stopping at the first that disagrees and naming what it lacks and adds. Combined starts from the opening file's columns, appends each newcomer where it appears, leaves gaps empty and reports both sides per file. By position ignores names, lining columns up by place.
A size ceiling counts bytes actually written: the repeated heading, the byte-order mark if you asked for one, your line endings, UTF-8 for the rest, so an accented letter costs more than one. Records are the unit, never lines, so a value holding a line break travels whole, and a record too large alone becomes its own piece rather than being cut.
Examples
id,name,email
1,Ada,ada@example.com
2,Linus,linus@example.com
3,Grace,grace@example.com
4,Alan,alan@example.com
5,Edsger,edsger@example.compart-1.csv
id,name,email
1,Ada,ada@example.com
2,Linus,linus@example.com
part-2.csv
id,name,email
3,Grace,grace@example.com
4,Alan,alan@example.com
part-3.csv
id,name,email
5,Edsger,edsger@example.comFive records at two per piece: three files, the last short, each opening with id,name,email. Names are numbered to the tally's width — 300 files start at part-001.csv, so alphabetical order is counting order.
order,city,total
1001,Berlin,42
1002,Osaka,17
1003,Lisbon,88
1004,Perth,23
1005,Dublin,64
1006,Quito,31
1007,Lima,55filename rows row range bytes
part-1.csv 3 1-3 60
part-2.csv 2 4-5 45
part-3.csv 2 6-7 43Seven into three cannot come out level, so leftovers go to the front — 3, 2, 2 — and a note states it: “7 rows do not divide evenly into 3 parts — the first 1 part carries one extra row”. Shown here is the manifest; its byte figures exclude the archive's overhead.
january.csv
id,name,plan
1,Ada,pro
2,Linus,free
february.csv
id,name,plan
3,Grace,teamid,name,plan
1,Ada,pro
2,Linus,free
3,Grace,teamTwo monthly exports naming the same three columns: one heading, then the records in listed order — 3 records, 48 bytes. The second heading is consumed.
signups.csv
id,name,email
1,Ada,ada@example.com
2,Linus,linus@example.com
callbacks.csv
id,name,phone
3,Grace,+46 8 123456id,name,email,phone
1,Ada,ada@example.com,
2,Linus,linus@example.com,
3,Grace,,+46 8 123456Combined, so the newcomer lands on the right: phone follows the first file's three columns, each gap an empty cell. The warning names the file and both sides — “is without "email" and adding "phone"” — and the report lists per file what matched, was absent, was extra.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
“Nothing to split” means nothing at all
Blank or whitespace-only text is declined; nothing partial is written. One line is not that case: nothing there separates heading from record, so it counts as one record.
More pieces than records is refused, not rounded
Eight pieces from five records stops, printing both figures and the largest tally that works; empty files are not invented.
One huge record beats the ceiling
A record bigger than the ceiling alone becomes an over-budget piece, warning included. Under 1,024 bytes is refused, as is a ceiling too small for heading plus record.
Repeated column names arrive numbered
A heading naming email twice reads as email and email_2, matching on those, so neither column swallows the other. A file numbering them otherwise lands in the report.
By position keeps other headings as records
Names ignored, only the opening file's first line counts as a heading; later files' first lines become records, ref,label and all — honest, when headings disagree.
Windows endings and the byte-order mark for Excel
CRLF and the mark reach every piece alike — 17 bytes where LF without the mark gave 13 — as a Windows spreadsheet expects. Splitting by a column's value is not offered here, nor .xlsx.
Common errors
file "march.csv": the column names do not match the first file — missing "plan"; unexpected "phone". Switch header handling to Union to keep every column, or align the header rows.- Identical was asked for and the second file was not. It is named, both differences listed, nothing written — Combined answers this without editing either export.
Cannot make 5 parts from 2 data rows — every part needs at least one row. Ask for 2 parts or fewer, or split by rows instead.- The ceiling on pieces is the record tally, and the number that works is printed, so the fix is a keystroke.
Splitting this way would write 2,000 parts, more than the 500 this tool writes in one run. Raise rows per part to 4 or more, or split this file in stages.- One run writes at most 500 files. The rows-per-piece figure it suggests comes from your own record tally.
Nothing to split — this input has no data rows. Paste CSV text or drop a .csv file with at least one row, then run Split again.- Nothing was pasted, or it held no records. The input is left as is; no partial output was written.
FAQ
Does every part keep the header row?
Yes, unless you turn the repeat off — then the opening piece keeps it and the rest begin with a record. A note beside the result says which.
What happens when two files have different columns?
Identical stops and names the difference. Combined keeps every column, empties the gaps, and reports per file what was absent or extra. By position ignores the names.
How big a file can I split here?
Up to 100 MB of text, into at most 500 pieces. Merging reads up to 50 files, 100 MB in total, 512 combined columns. Past any of those the run is declined, figure included.
Keyboard shortcuts
- ⌘/Ctrl + Enter
- Run the split or merge again.
- ⌘/Ctrl + C
- Takes the artifact unless text is highlighted.
- ⌘/Ctrl + Shift + C
- Take it despite a highlight.
- ⌘/Ctrl + S
- Save the archive, or the merged file.
- t
- Switch palettes; ignored while typing.
- ? or ⌘/Ctrl + /
- Open this list in the tool.
- Esc
- Close the topmost panel.