How to Sort a Large CSV File (Without the Wait)
Need to sort a large CSV but Excel freezes or caps out? Here's why sorting big files is slow, what multi-column sort means, and how to do it fast then save.
You have a large CSV — a database export, an analytics dump, a log file — and you just need it in order: highest values first, or grouped by category, or newest at the top. In a small file that's a two-second job. In a large one, sorting is exactly where a spreadsheet app falls over. This guide explains why, then shows you how to sort a big file quickly and save the result.
Why sorting a big CSV is painful in Excel and Sheets
Sorting is one of the most demanding things you can ask of a spreadsheet, because it touches every row at once.
Everything loads first. Excel can't sort what it hasn't read, so it pulls the entire file into memory and builds a live cell for every value before the sort even starts. A few hundred megabytes on disk can balloon into several gigabytes of RAM. That's the spinning cursor and the "Not Responding" title bar — the app is still loading and laying out cells you'll never look at.
The row cap bites first. An Excel worksheet stops at 1,048,576 rows. If your CSV is larger, Excel silently drops everything past that line. You can sort a truncated file all day; the bottom of your data is already gone, and nothing warns you.
The sort itself drags. Even when the file fits, reordering a million rows across a dozen columns is a lot of work, and it runs inside the same interface that's trying to keep the screen drawn. The bigger the file, the longer the freeze. Google Sheets isn't a way out either: it caps at 10 million cells total, which a wide file blows past well before a million rows, and it uploads your data to the cloud to get there.
The result is that a job which should take a moment turns into a coffee break — or fails outright.
What a multi-column sort actually means
A single-column sort orders rows by one column. A multi-column sort (also called a multi-key sort) orders by several columns in priority order: it sorts by the first key, and only when two rows tie on that key does it use the second key to break the tie, then the third, and so on. Each key can run ascending or descending independently.
Here's a concrete example. Say you have an employee export with Department, Name, and Salary. You want to see each department grouped together, and within each department the highest earners at the top. That's two keys:
- Department — ascending (groups all of Engineering together, then Finance, then Sales).
- Salary — descending (inside each department, the top earner comes first).
Sort by those two keys and you get a clean, readable layout: departments in alphabetical blocks, each block ranked from highest paid to lowest. A single-column sort can't express that — you'd get departments grouped or salaries ranked, but not both at once.
How to sort a large CSV quickly
The fix is the same one that makes large files openable in the first place: keep the data in a fast core and only draw what's on screen. CEESVEE is a free, open-source (MIT) CSV and delimited-file editor that does exactly this. The dataset lives in a Rust core, the grid is virtualized so it paints only the visible rows, and — crucially — the sort runs in the Rust core too. That's why it stays fast on a file Excel would choke on. It runs on Windows, macOS, and Linux, and everything happens on your machine — your file is never uploaded.
To sort the employee file from the example above:
- Download CEESVEE and open your file — drag it onto the window or use File → Open. The delimiter and encoding are auto-detected, so a typical export opens with no setup. For more on opening oversized exports, see opening large CSV files.
- Open the sort controls and add your first key: choose Department, direction ascending.
- Add a second key: choose Salary, direction descending. This is the tie-breaker that ranks each department internally.
- Apply the sort. Because the work happens in the Rust core, even a million-row file reorders without the long freeze you'd expect from a spreadsheet. The frozen header row keeps your column names in view as you scroll the result.
- Spot-check it. Select a range of the
Salarycolumn and read the live selection stats — count, sum, average, min, max — in the status bar to confirm the numbers look right before you save.
Add more keys whenever you need finer ordering — for instance a third key on Name ascending to alphabetize people who happen to share a department and salary.
Save the sorted file
Sorting only reorders the view; your file on disk is untouched until you save. When the order looks right:
- Use Save to write the sorted rows back to the same file, or Save As to keep the original and write a new one.
- On Save As, you control the output explicitly — delimiter (comma, tab, semicolon, pipe), encoding, quoting, line endings (LF or CRLF), and BOM on or off — so the sorted file matches whatever the next tool expects.
Because the save is faithful to those settings, you don't end up with a sorted file that's subtly reformatted. And if you change your mind, undo/redo lets you step back through sorts and edits before committing.
The bottom line
Sorting a large CSV isn't slow because sorting is hard — it's slow because spreadsheet apps load and render the whole file to do it, and Excel caps out at 1,048,576 rows on top of that. Move the sort into a fast core that only draws what's on screen, and a multi-column sort on a million rows stops being a coffee break and becomes instant.
Download CEESVEE for free and sort that big file without the wait.
Frequently asked questions
Why is sorting a large CSV so slow in Excel?
Excel loads the entire file into memory and builds a live cell for every value before it can sort. On a large file that means high RAM use, long pauses, and a 'Not Responding' window. A worksheet is also capped at 1,048,576 rows, so anything past that is dropped before you even sort.
What is a multi-column sort?
A multi-column (multi-key) sort orders rows by one column first, then breaks ties using a second column, then a third, and so on. For example, sort by Department ascending, then by Salary descending, to group people by department and rank each group from highest paid to lowest.
How does CEESVEE sort large files quickly?
Sorting runs in CEESVEE's Rust core rather than in the interface, and the grid only draws the rows on screen. That keeps sorting fast and the window responsive even on a 1,000,000-row, 100 MB+ file.
Does sorting change my original file?
Not until you save. The sort reorders rows in the view; your file on disk is unchanged until you use Save or Save As, so you can sort, inspect, and undo freely first.