CSV Sorter
Choose the main column to sort by, then up to two more to break ties. Each level can sort as text, numbers or dates, from low to high or high to low.
Drag a file here or choose one
Worked examples
Numbers, high to low
Name,Score Ann,42 Bob,9 Cara,100
Name,Score Cara,100 Ann,42 Bob,9
Sorted as numbers, largest first. As text, 9 would have come first.
Two levels
Name,Team,Score Ann,Blue,42 Bob,Red,37 Cara,Blue,50
Name,Team,Score Cara,Blue,50 Ann,Blue,42 Bob,Red,37
Team A to Z, then score from high to low inside each team.
About CSV Sorter
Sorting a table by one column is easy; sorting properly is harder. Sorted as text, 10 comes before 2 and 9 sorts after 100. Dates written as 05/03/2023 sort by day first. This sorter reads each column for what it holds: numbers, including amounts with currency signs and thousands commas, are sorted by value, dates by calendar order, and text in a natural order where item2 comes before item10 and capital letters are ignored.
You can sort by up to three columns, for example team first, then score from high to low, then name. Rows that tie on every level keep the order they had, and blank cells always go to the end whichever direction you choose. If a column could be read two ways, such as a mix of numbers and notes, pick how to read it yourself.
How to use CSV Sorter
- Paste your CSV or open a file.
- Choose the first column to sort by and whether to read it as text, numbers or dates. Work it out is the default.
- Add a second and third level if you need to break ties, and choose the direction of each.
- Check the preview, then download the sorted file.
Common uses
- Ranking sales or scores from highest to lowest
- Putting a list in date order
- Sorting by team and then by name
- Preparing a file for a system that needs sorted input
Frequently asked questions
Why does my number column sort wrongly in other tools?
They sort it as text, where the first character decides. Here a column is treated as numbers when every filled cell is a number, so 9 comes before 10 and 100.
How are dates sorted?
As dates, from earliest to latest. A column is read as dates when every filled cell is a date. If numbers such as 03/04/2024 could mean two things, choose day first or month first.
Where do blank cells go?
At the end, in both directions. This keeps the useful rows at the top whether you sort high to low or low to high.
Is the sort stable?
Yes. Rows that are equal on every level stay in the order they were in. Adding an ID column as a last level makes the order fully repeatable.
Is the text sort case sensitive?
No. Text is sorted ignoring capitals, in a natural order, so Item2 comes before item10.