CSV Row Sorter
Sorts rows by a named column, treating numeric columns as numbers rather than text.
Loading the tool…
Processing happens locally in your browser.
What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.
How to use this tool
- Paste the CSV.
- Type the name of the column to sort by, exactly as it appears in the header.
- Choose ascending or descending and sort.
What csv sorter does
Sorting a CSV in a text editor sorts it as text, which puts 10 before 2 and puts every capitalised value before every lower-case one. This sorter checks whether the chosen column is numeric throughout and, if it is, compares the values as numbers. Otherwise it uses a natural text comparison that still handles embedded digits sensibly.
The header row is never sorted with the data, which is the other thing a plain text sort gets wrong. Empty values are treated as zero in a numeric sort and as an empty string in a text sort, so they collect at one end rather than being scattered through the file.
Frequently asked questions
A plain text sort compares character by character, which puts 10 before 2. This sorter checks whether every value in the column is numeric and compares as numbers when it is.
No. The header is held aside and written back at the top, which is the other thing a text-editor sort gets wrong.
In a numeric sort they are treated as zero; in a text sort they compare as an empty string. Either way they collect at one end rather than being scattered.