Skip to content

Split CSV

Break a large CSV into smaller files, each with the header row.

Drop a CSV file here

Only your browser reads them.

How to use Split CSV

  1. Add a spreadsheet file. Drop a .csv, .tsv, or .txt file onto the drop zone to load it into local worker memory.
  2. Choose your split mode. Pick Rows per file (1 to 10,000,000) or Number of files (2 to 1,000), and keep Repeat the header row in every file checked if each chunk needs column names.
  3. Download the archive. Click Split CSV to generate zero-padded parts with UTF-8 encoding inside a compressed ZIP file.

Your files are processed on this device and never uploaded. They stay private, and there's nothing to delete afterwards.

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.

Questions

What happens if a CSV file has fewer rows than the chosen split limit?

If your file already fits inside a single chunk or has fewer than 2 data rows, the worker stops and displays a clear error message instead of creating a redundant archive. Lower the rows-per-file value or switch modes to split it.

Can I repeat the header row in every split CSV file?

Yes. Repeat the header row in every file is checked by default, copying your first row of column names to the top of every output file. Uncheck it whenever you are splitting a headerless data export.

Does the CSV splitter support semicolon and tab delimiters?

Yes. The delimiter detector inspects up to 10,000 characters across the first 10 logical rows to identify comma, semicolon, tab, or pipe separators automatically, then writes every split part using that same delimiter.

Why do split CSV files include a UTF-8 BOM for Excel?

Microsoft Excel often misreads plain UTF-8 CSV files as legacy ANSI encoding when non-ASCII characters appear, scrambling accents and symbols. Prepending a UTF-8 Byte Order Mark ensures Excel opens every split part with accurate international text.

What naming convention is used for the generated split files?

Output chunks use zero-padded part numbers based on your original filename, such as orders-part-01.csv and orders-part-02.csv, inside a compressed orders-split.zip archive. Zero-padding keeps files sorted in numerical order across operating systems.

Why split a CSV file in your browser instead of using command-line tools?

Command-line utilities like split count raw newline characters and cut multi-line quoted cells in half, whereas this browser splitter parses RFC 4180 quotes, repeats header rows, adds a UTF-8 BOM for Excel, and requires zero installation.

Updated