Skip to content

Free · Browser-local tools

Split CSV files

Split CSV by record count, UTF-8 file size or desired file count. Preserve record boundaries and download individual files or a ZIP.

Split CSV

Start with your CSV

Open your file in the CSV editor with this tool already selected. Preview the result before downloading.

  1. Open your CSV and choose records per file, a byte budget or a file count.
  2. Choose repeated headers and preview file sizes and records.
  3. Download individual parts or one ZIP.

Free · No signup · File contents stay in your browser. Open files up to 1 GiB with browser storage.

Try a small example

3 records · 3 columns
Illustrative CSV sample data
idnameamount
1Example one12
2Example two24
3Example three18

At 2 records per file: part 1 contains IDs 1 and 2; part 2 contains ID 3. Headers repeat when selected.

Illustrative fictional data. Open the sample to try the tool.

How to split csv

  1. 1

    Open your CSV and choose records per file, a byte budget or a file count.

  2. 2

    Choose repeated headers and preview file sizes and records.

  3. 3

    Download individual parts or one ZIP.

What to expect

Splits at parsed CSV record boundaries, preserving quoted newlines. Byte budgets include serialization and repeated headers; records that cannot fit are reported. At most 1,000 output files.

Local files and clear limits

These tools process file contents on your device. The browser workspace accepts files up to 1 GiB and 5 million records, subject to available browser storage and decoded-record limits. This tool's calculations support up to 100,000 records, 2 million cells and 64 MB of text. Download a new copy to keep your result.

Plain answers

Split CSV questions

Will splitting preserve headers and quoted multiline records?

Splits at parsed CSV record boundaries, preserving quoted newlines. Byte budgets include serialization and repeated headers; records that cannot fit are reported. At most 1,000 output files.

Does my CSV leave my device?

File selection, editing and these task operations run in your browser. Optional recipe assistance, when available, sends your goal and only the column metadata or sample values you explicitly include to its configured provider. Your file is not attached automatically; see Privacy for processing details. Manual editing requires no account or file upload. Download a new copy to keep your result; refreshing restores the original input, not unsaved edits.

Do the editor and task have the same file limits?

The editor opens files up to 1 GiB and 5 million records, subject to browser storage and decoded-record limits. This task supports up to 100,000 records, 2 million cells and 64 MB of decoded text.

Other ways to work with your CSV

Use these local examples when you prefer a script or SQL. They create separate results and explain where their behavior differs from this browser tool.

Split CSV at parsed record boundaries with Python

Creates part-001.csv and following parts with at most 1,000 data records each and a repeated header. Quoted multiline fields are never split across files.

Before you start

  • Python 3.10 or later. Run in a working folder with a backup of your source; output files may be replaced unless opened in exclusive mode.
  • Place input.csv in that folder. Examples use UTF-8, a comma delimiter and a header row. Column-specific recipes use id,label,amount,status,note; adapt names to your file.
Run the complete Python example
python3 - <<'PY'
import csv
from itertools import islice

records_per_file = 1000
with open("input.csv", encoding="utf-8-sig", newline="") as source:
    reader = csv.reader(source, strict=True)
    headers = next(reader, None)
    if headers is None:
        raise ValueError("Expected a header")
    part = 0
    while batch := list(islice(reader, records_per_file)):
        if any(len(row) != len(headers) for row in batch):
            raise ValueError("A record has the wrong field count")
        part += 1
        with open(f"part-{part:03}.csv", "x", encoding="utf-8", newline="") as target:
            writer = csv.writer(target)
            writer.writerow(headers)
            writer.writerows(batch)
print(f"Wrote {part} parts")
PY

Limits and output

  • CSV has no stored type schema. Python keeps fields as strings until an example explicitly converts a value. These recipes do not add spreadsheet formula protection; import sensitive-looking strings as text in spreadsheets.
  • This recipe splits by record count, not byte size. It refuses to overwrite existing parts; a later malformed record can leave earlier parts on disk.

Documentation: Python CSV reader and writer