Skip to content
toolgrid

No tool found. Try another word.

CSV Sorter

Sort a CSV file by one or more columns, ascending or descending. Numbers are sorted as numbers, text alphabetically, empty values last.

Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.

How to use the CSV Sorter

  1. 1 Paste the CSV or open the file.
  2. 2 Choose the column to sort by and the order; add more columns for ties.
  3. 3 Copy or download the sorted CSV.

About the CSV Sorter

Sort a CSV file the way you would in a spreadsheet, without opening one. Choose a column and ascending or descending order; add a second and third column to decide the order of rows that are equal in the first, for example by country and then by city.

With "automatic", a column is sorted numerically when all its values are numbers, so 2 comes before 10, and alphabetically otherwise. Alphabetical sorting ignores case and accents (Äpfel next to Apfel) and is stable: rows that are equal keep their original order.

Empty values go to the end in both directions, so incomplete rows do not end up at the top. The header row stays at the top.

Frequently asked questions

Why is 10 sorted before 9?

The column is sorted as text, probably because it contains a value that is not a number. Choose "number" as comparison to sort numerically anyway; text values then go after the numbers.

Can I sort by several columns?

Yes. Click "Add sort column": the next column decides the order when the previous ones are equal.

Are dates sorted correctly?

Dates in the YYYY-MM-DD format sort correctly as text. Other formats like 31-12-2025 do not; convert them first if needed.

Does sorting change the values?

No, only the order of the rows changes.