convert

Sort CSV

Sort CSV rows by any column as text, numbers or dates, keeping the header row in place.

Runs on your deviceBatch readyPaste textNew

Paste or drop

Paste text below, or drop a file instead.

0 chars · 0 lines
…or drop a file
Drag and drop, or choose files
CSVTSVTXT

Choose an output

Sort CSV rows by any column as text, numbers or dates, keeping the header row in place.

Fine-tune

Optional — sensible defaults are already set.

Compare as

About Sort CSV

This tool sorts the rows of a CSV by one column and keeps the header row at the top. It can compare values as text in natural order, as numbers or as dates, and auto-detect picks numeric sorting when the column holds only numbers. Rows with an empty sort value always go to the bottom.

When it helps

  • Ranking sales, scores or prices from highest to lowest.
  • Putting a list of names or file names in alphabetical order before sharing it.
  • Ordering log or transaction exports by date before review.

Tips

  • Give the column by its header name or by number, starting at 1. A name you type is matched to the header even if the capitalization differs.
  • Number mode ignores thousands separators, spaces and $, euro, pound and % signs, so "$1,200" sorts as 1200.
  • Date mode works best with ISO dates like 2024-03-15. Formats like 03/04/2024 are read the way your browser reads them, which may not match your locale.
  • Text mode uses natural order, so item2 comes before item10, and it isn't case-sensitive.

Good to know

Quick answers about sort csv in your browser.

That is plain text ordering. Auto-detect switches to number sorting only if every value in the column is a number, so a stray word or "N/A" keeps it in text mode. Choose "Number" to force numeric sorting.

Yes. The sort is stable: rows with the same value keep their relative order, so you can sort by a secondary column first and then by the main column.

Yes. There is no sign-up, no watermark and no limit on how many files you process.

No. Files are read and processed locally in your browser, so they never leave your device.

Related tools