CSV Sorter

Sort CSV rows by a chosen column.

Input
CSV input
Output
Result
Options

Detected automatically unless you pick one.

About this tool


Sorting rows by a column is trivial in a spreadsheet and awkward from the command line. This does it in the browser, keeping the header in place and choosing numeric or text ordering based on what the column actually contains.

The distinction matters more than it sounds: sorted as text, 10 comes before 9, which is the single most common CSV sorting mistake.

How to use it

  1. Paste or upload your csvDrop a file onto the input pane, use the file picker, or paste the text directly.
  2. Adjust the options if neededThe defaults suit most input; open Options to change the behaviour.
  3. SortPress Sort, or use Ctrl+Enter (Cmd+Enter on macOS).
  4. Copy or downloadCopy the result, or download it as a .csv file.

Worked examples


Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.

Numeric ordering detected

Input

n
10
9
100

Output

n
9
10
100

Sorted as numbers. As text, 10 would have come before 9.

What to watch for


The details that decide whether a conversion is correct, and where information can be lost without any error being raised.

Numeric versus text ordering
If every value in the column is numeric, numeric ordering is used, so 9 sorts before 10. If any value is not, text ordering is used and reported in a warning. You can force either mode when a column mixes numbers with occasional text.
Text sorting is natural and case-insensitive
Comparison uses locale-aware natural ordering, so item2 sorts before item10 and case does not affect position. This matches how people expect a list to read, rather than raw byte ordering where uppercase sorts before lowercase.
Blank values sort last
Empty cells are placed at the end regardless of direction, so missing data never interrupts the sorted sequence.
Single column, stable order
Sorting is by one column. Rows with equal values keep their original relative order, which means you can sort twice (secondary key first, then primary) to achieve a multi-column sort.

Limitations


  • Sorts by a single column per run.
  • Text sorting uses the browser locale, which can differ slightly between users.
  • Processing happens in your browser, so very large inputs are bounded by available memory. Files above roughly 10 MB are handled but will feel slower, and multi-hundred-megabyte files are better suited to a command-line tool.

Questions


Can I sort by more than one column?
Not in one pass, but the sort is stable, so sorting by the secondary column first and then the primary gives the same result.
Why did my numbers sort in the wrong order?
The column probably contains a non-numeric value, so text ordering was used. Force numeric mode in Options.