Data Conversion Tools Runs in your browser Free · no account

CSV Sorter

The CSV sorter orders rows by the columns you nominate, ascending or descending, keeping the header row in place. Sorting is stable, so rows that compare equal stay in their original order — which is what lets you sort by a second column and then a first to get a reliable multi-level sort.

Options
CSV 0 characters
Sorted CSV

Your result will appear here.

Not sure where to start? Use Load example.

Results update automatically and are calculated on your device. Nothing you type is sent to a server.

Runs in your browser. Processing happens entirely in your browser. Nothing you enter is sent to Delimiter.live.

How to use the CSV Sorter

  1. Paste or upload the CSV file.
  2. Name the column to sort by. Add more, separated by commas, to break ties with a second and third key.
  3. Choose the direction, and set the comparison type if the automatic choice gets it wrong.
  4. Copy or download the sorted file.

Example

Input
name,score
Ada,90
Grace,95
Output
name,score
Grace,95
Ada,90

Common use cases

  • Ordering an export by date or score before sharing it.
  • Grouping rows by category so related records sit together.
  • Sorting by a key column before de-duplicating, so the row you keep is the one you want.
  • Putting a file into a predictable order so two versions can be diffed.

Limitations and things to watch for

  • Dates sort correctly only in a format where alphabetical order matches chronological order, such as ISO 8601. A column of dd/mm/yyyy values will not sort into date order.
  • Automatic comparison is numeric-aware, so "item 10" sorts after "item 9". Choose the text option if you want strict character-by-character ordering.
  • When sorting as numbers, values that are not numeric sort to the end rather than being dropped or scrambled.

Frequently asked questions

Can I sort by more than one column?
Yes. Name them in order of priority, separated by commas — the first is the primary key and later ones break ties. The sort is also stable, so you can achieve the same result by sorting by the least significant column first.
Why did my dates sort incorrectly?
Because dates are compared as text. That works for ISO 8601 dates such as 2026-08-07, where alphabetical and chronological order coincide, but not for dd/mm/yyyy. Convert the column to ISO format first.
What does stable sorting mean here?
Rows that compare equal keep the order they had in the input rather than being shuffled. It means a second sort refines the first rather than discarding it, and that repeating the same sort always gives the same file.
Is the header row sorted with the data?
No. With the header setting on, the first row is held aside and written back at the top, so it stays a header rather than being sorted into the middle of the file.

Share this tool