How does the RFC 4180 parser avoid cutting multi-line rows in half?
Reading the entire file through a state-machine parser rather than splitting on raw \n newline characters guarantees every logical record stays whole. When an address, product description, or support note spans multiple lines inside double quotes, the parser tracks quote state across line breaks so chunks only break between complete records.
Following the IETF RFC 4180 CSV specification, fields containing delimiters, line breaks, or escaped double quotes ("") remain properly enclosed when written back out. If you are starting from a multi-sheet workbook instead of a flat file, you can save .xlsx sheets as CSV first and drop the exported sheet here.
Before splitting begins, unclosedQuoteLine() validates quote balance across the entire file. If a malformed export leaves an unclosed quotation mark, the tool stops immediately and reports the exact line number so you can repair the broken row instead of generating corrupt parts.
State-machine quoting vs naive line splitting
Command-line scripts and simple online splitters that count newline characters break the moment a customer comment includes a paragraph break. Those broken halves shift every remaining column to the wrong field when imported into a database or spreadsheet.
By parsing cells character by character inside everyday.worker.ts, trailing empty lines at the bottom of the file are also trimmed cleanly before calculating chunk boundaries. That prevents empty trailing part files from being created.
Auto-detecting comma, semicolon, tab, and pipe delimiters
European exports often separate columns with semicolons (;), while database dumps frequently use tabs (\t) or pipes (|). The delimiter detector scans up to 10,000 characters across the first 10 logical rows, scoring candidate separators by column consistency outside quotes.
Once detected, every split output file preserves your original separator automatically. You never need to guess or manually configure delimiter flags before splitting .csv, .tsv, or .txt files.
How to split a large CSV file into smaller files by rows or parts
Two modes in the Split by control match the two most common reasons teams break up oversized exports. Choose Rows per file when an import portal enforces a strict row cap, or choose Number of files when distributing leads evenly across teammates or parallel batch jobs.
If you later want to turn one of those smaller chunks back into a formatted workbook for stakeholders, convert csv to xlsx locally after unpacking.
| Split mode | Input range | Default value | Best workflow use case |
|---|---|---|---|
| Rows per file | 1 to 10,000,000 | 1,000 rows | CRM, Shopify, or SQL batch import limits |
| Number of files | 2 to 1,000 parts | 2 files | Dividing lead lists evenly across reviewers |
| Repeat header row | Checked or unchecked | Checked | Preserving column names on every chunk |
| ZIP packaging | Compressed UTF-8 | Automatic | Single download for all zero-padded parts |
Capping rows per part for CRM and database imports
In Rows per file mode, enter any integer between 1 and 10,000,000 in Rows in each file (defaulting to 1,000). Data rows are sliced cleanly into batches of that exact size, with the final part holding any remainder.
If your file already has fewer data rows than your chosen limit, the worker alerts you instead of creating a redundant single-file archive. Lowering the row threshold fixes that immediately.
Dividing datasets into an exact number of parts
Switching Split by to Number of files lets you pick between 2 and 1,000 output files. The splitter computes Math.ceil(bodyRows / min(parts, bodyRows)) so records distribute evenly without exceeding your requested part count.
Repeating header rows, UTF-8 BOM encoding, and ZIP packaging
Keeping Repeat the header row in every file checked copies row one to the top of each generated CSV chunk, ensuring every file remains self-contained for downstream importers. Uncheck that box only when splitting a raw dataset that has no column header row.
Every chunk is encoded in UTF-8 according to the IETF RFC 3629 UTF-8 specification and prefixed with a \ufeff Byte Order Mark (BOM) so Microsoft Excel recognizes accented characters, currency symbols, and non-Latin scripts without mojibake. After downloading <stem>-split.zip, you can unzip and save what’s inside right in your browser using the built-in archive extractor.
Tip: Leave Repeat the header row in every file checked when uploading chunks sequentially into HubSpot, Salesforce, or Airtable, since each upload expects column headers on row one.
Preserving column headers in every chunk
When header repetition is enabled, row one is excluded from the data-row count before slicing chunks. A 2,500-data-row file split at 1,000 rows per file produces three files containing 1,000, 1,000, and 500 data rows respectively, each preceded by the header row.
Zero-padded part names and UTF-8 BOM for Excel
Part filenames are zero-padded to match the total part count, such as orders-part-01.csv through orders-part-12.csv, so files sort in exact numerical order in Finder, Explorer, and shell scripts. All parts are compressed into <stem>-split.zip inside the worker.
When should you split a CSV locally in a Web Worker?
Split CSV files locally in a Web Worker whenever your dataset contains customer emails, payroll figures, invoices, or internal records that should never be uploaded to third-party servers. Transferring raw file bytes via ArrayBuffer into everyday.worker.ts also keeps browser scrolling and buttons responsive even on multi-megabyte files.
Media type conventions follow the IANA text/csv Media Type Registration, supporting .csv, .tsv, and .txt inputs cleanly. If your upstream system exports hierarchical feeds instead of flat tables, you can also turn XML records into rows first and then split the resulting table into manageable chunks.
Desktop browsers comfortably process files of several hundred MB in local memory, making client-side splitting fast and private from start to finish. Keeping every byte inside your browser tab eliminates cloud upload queues, avoids arbitrary server file size limits, and protects confidential spreadsheets.