Browser-native file tools

Split a Large CSV Into Smaller Files

Drop a CSV below — split it into N-row chunks, or one file per unique value in a column. Header preserved on every output. No upload.

— or paste CSV below

How to split a CSV file

The fastest way: drop your CSV into the splitter at the top of this page, pick a mode (by row count or by column value), then download each chunk — or all of them at once. The header row is copied into every output file automatically. Runs entirely in your browser using PapaParse — no upload.

  1. Upload your CSV (drag-and-drop or click) or paste the contents into the input.
  2. Pick the split mode:
    • By row count — break the file into N-row chunks (e.g. 1000 rows each).
    • By column value — emit one file per unique value in a column (e.g. one file per region).
  3. Configure — enter rows-per-file or pick the column to group on.
  4. Download each chunk individually, or click Download all to save every output file with one click.

Each output is a complete, valid CSV with the original header row, ready to open in Excel, Numbers, or load into pandas.

Split CSV by row count

The most common reason to split: the file is too big. Excel caps at 1,048,576 rows; Google Sheets at 10 million cells. If your CSV has 3 million rows, you need to break it up to view or edit it.

Given a 3-million-row orders.csv and a chunk size of 500,000, the splitter produces:

orders_part1.csv   (header + rows 1–500,000)
orders_part2.csv   (header + rows 500,001–1,000,000)
orders_part3.csv   (header + rows 1,000,001–1,500,000)
orders_part4.csv   (header + rows 1,500,001–2,000,000)
orders_part5.csv   (header + rows 2,000,001–2,500,000)
orders_part6.csv   (header + rows 2,500,001–3,000,000)

Pick a chunk size that fits your downstream tool: 1M for Excel, 100K–500K for fast pandas iteration, 10K–50K for batch API uploads.

Split CSV by column value

The second mode is for splitting a master file into per-group exports. Examples:

  • A global sales export → one file per region (NA, EU, APAC).
  • A customer-orders dump → one file per customer.
  • A multi-tenant log file → one file per tenant_id.
  • A categorized inventory → one file per category.

Given:

region,name,amount
NA,Ada,120
EU,Linus,80
NA,Grace,200
EU,Edsger,55
APAC,Yukihiro,90

Splitting by region produces three files:

data_region_NA.csv     → Ada, Grace
data_region_EU.csv     → Linus, Edsger
data_region_APAC.csv   → Yukihiro

Each file keeps the original header. Empty values in the split column go into a _blank bucket so no row is dropped.

How to split a CSV in Excel, Python, or the command line

The browser splitter is best for ad-hoc splits up to a few hundred MB. For larger files or repeatable pipelines, use one of these.

Unix split command

The fastest way to chop a huge CSV by line count:

# Split big.csv into 100,000-line chunks named chunk_aa, chunk_ab, ...
split -l 100000 big.csv chunk_

# Add a numeric suffix and a .csv extension
split -l 100000 -d --additional-suffix=.csv big.csv chunk_

Caveat: split doesn’t know about CSV headers. The first chunk has the header; the rest don’t. Fix that with a quick loop:

HEADER=$(head -n 1 big.csv)
split -l 100000 --additional-suffix=.csv <(tail -n +2 big.csv) chunk_
for f in chunk_*.csv; do
  echo "$HEADER" | cat - "$f" > "$f.tmp" && mv "$f.tmp" "$f"
done

The browser splitter at the top of this page handles this for you automatically.

pandas (Python) — split by row count

import pandas as pd

CHUNK = 100_000
for i, chunk in enumerate(pd.read_csv("big.csv", chunksize=CHUNK), start=1):
    chunk.to_csv(f"orders_part{i:03d}.csv", index=False)

read_csv(chunksize=...) streams the file so you never load the whole thing into memory — works on 10 GB files on a laptop.

pandas — split by column value (groupby)

import pandas as pd

df = pd.read_csv("orders.csv")
for region, group in df.groupby("region"):
    group.to_csv(f"orders_{region}.csv", index=False)

Three lines. groupby is the canonical idiom for splitting by column value.

awk one-liner (split by column value)

# Split big.csv into per-region files based on column 1
awk -F, 'NR==1{h=$0; next} {f="region_"$1".csv"; if(!(f in seen)){print h > f; seen[f]=1} print >> f}' big.csv

Common splitting problems

”The chunks don’t have headers”

The classic mistake when using Unix split. Every chunk after the first lacks the header row. The browser splitter and the pandas approach above both preserve headers; the bare split command does not — use the loop in the section above to re-prepend the header.

”Encoding got mangled (é → é)”

Your source CSV is probably UTF-8 with a BOM, or Windows-1252 mislabeled as UTF-8. Open the file in a text editor that shows encoding (VS Code, BBEdit) and re-save as UTF-8. The browser splitter reads files as UTF-8; if the source uses a different encoding, convert it first with iconv -f WINDOWS-1252 -t UTF-8 in.csv > out.csv.

”The browser tab freezes / runs out of memory”

The browser holds the entire CSV in RAM. Past a few hundred MB you’ll see slowdowns; past a gigabyte you may hit out-of-memory errors. For very large files use the split command or pandas with chunksize=. Both stream the file from disk and never need to load it whole.

”Download all stops after ~10 files”

Browsers limit how many files a page can trigger downloads for in quick succession. The splitter spaces downloads out by ~120ms, which works up to ~30–50 files in most browsers. Past that, click individual Download buttons or use the command-line tools above.

”Quoted fields with commas got broken”

Naïve splitters that just count commas break on "Smith, John". The splitter on this page uses a real CSV parser (PapaParse), so quoted commas, embedded newlines, and escaped quotes are all preserved correctly. If you split with split -l or naïve scripts, you risk corrupting rows that span multiple lines.

When to split a CSV vs use a database

Splitting is the right call when you need separate physical files — to email, upload to per-folder destinations, or hand off to a tool that processes one file at a time. It’s the wrong call if you’re trying to query a slice of the data: don’t split a 10M-row CSV just to find rows where region = 'EU'. Instead, convert it to SQL and run a query, or load it into SQLite with .import and use WHERE.

Quick rule of thumb:

  • Split when downstream consumers need separate files (per-tenant exports, per-team uploads, chunked uploads).
  • Query (SQL or pandas) when you need a filtered or aggregated subset for analysis.
  • Stream (pandas chunksize, awk) when you’re transforming row-by-row and never need the whole file in memory.

Privacy: nothing is uploaded

Splitting runs entirely in your browser using PapaParse for parsing and Blob URLs for downloads. No file ever reaches a server — verify in DevTools → Network. This matters when your CSV contains customer records, internal IDs, or anything you wouldn’t paste into a public web form.

After splitting, you can view a chunk, merge chunks back together, or convert one to SQL inserts for loading into a database.

Related tools

Frequently asked questions

  • How do I split a CSV file by row count?

    Drop your CSV into the splitter at the top of this page, pick 'By row count', enter how many rows you want per output file (e.g. 1000), and download each chunk individually or all at once. The header row is copied into every output file automatically.

  • How do I split a CSV by column value?

    Pick 'By column value' and select the column to group on (e.g. region, category, customer_id). The tool produces one CSV per unique value, named like `data_region_NA.csv`, `data_region_EU.csv`. Useful for splitting a master file into per-team or per-region exports.

  • Is the header row preserved on every output file?

    Yes. Each chunk is a complete, valid CSV — same header row as the source, then a subset of the data rows. You can open any chunk in Excel, Numbers, or pandas without extra steps.

  • What's the maximum file size I can split?

    There is no hard limit, but the splitter runs entirely in your browser, so you're bounded by available RAM. As a rule of thumb: under ~200 MB works smoothly on most laptops; 200 MB–1 GB works but may be slow; past that you should use the `split` command-line tool or pandas.

  • Why would I split a CSV file?

    Common reasons: (1) the file is too big to open in Excel (Excel caps at 1,048,576 rows); (2) you want to email or share chunks under an attachment size limit; (3) you need per-region/per-team subsets from a master export; (4) you want to load chunks in parallel into a database; (5) you're chunking for batch processing or rate-limited APIs.

  • Can I split a CSV with millions of rows?

    The browser can handle a few million rows if your machine has enough RAM, but for very large files (5M+ rows or 1 GB+) the right tool is the Unix `split` command (`split -l 100000 big.csv chunk_`) or pandas `read_csv(chunksize=...)`. The article below has both. Use this tool for files small enough to load comfortably in a browser tab.

  • Does it handle quoted fields and embedded commas correctly?

    Yes — the splitter uses PapaParse to parse and re-emit CSV, so quoted fields, embedded commas, embedded newlines, and escaped quotes are preserved correctly. The output is RFC 4180 compliant.

  • Is my CSV uploaded?

    No. Splitting runs entirely in your browser using PapaParse. Your data never reaches a server. You can verify in DevTools → Network — you'll see no requests when splitting.