Back to blog

Guide

How to split a CSV into smaller files

Break large exports into manageable chunks for Excel or email.

Jan 17, 20254 min read
A million-row export won't fit in Excel or attach to an email. Splitting it into smaller files solves both problems while keeping your data organized.

Decide your chunk size

Excel handles about one million rows, but performance degrades long before that. For smooth editing, keep files under 100,000 rows. For email attachments, stay under 10MB.

  • Excel limit: ~1,048,576 rows
  • Performance sweet spot: under 100,000 rows
  • Email attachment limit: usually 10-25MB

Preserve headers

Each chunk needs the header row to make sense. Good splitting tools copy headers to every output file automatically.

  • Headers identify columns
  • Missing headers cause import errors
  • Consistent headers enable recombination

Quick CTA

View without splitting

Readable CSV opens files of any size. Skip the splitting step entirely.

Try it

Use command line tools

The split command on Mac and Linux handles this quickly. For Windows, PowerShell or dedicated tools work. Specify lines per file and let it run.

  • split -l 50000 data.csv chunk_ on Unix
  • PowerShell Get-Content with batching on Windows
  • Third-party tools add header preservation

Name files systematically

Use sequential numbering so files sort correctly. Include the total count if helpful. chunk_001_of_010.csv tells you exactly where you are.

  • Zero-pad numbers for correct sorting
  • Include date if splitting by time
  • Add row ranges for easy reference

Key takeaway

Split files when you need to share or edit in Excel. Keep them whole when you just need to view and search.