Cleanroom nothing leaves your browser

HomeCSV tools › Sort CSV

Runs in your browser

Sort a CSV by column

Sorting in a spreadsheet is easy until the file is too large to open, or until you sort one column and the rest of the row stays put. This sorts whole rows by the column you name, detects automatically whether the values are numbers or text, and keeps rows with equal values in their original order.

How to use it

  1. Choose your CSV file.
  2. Type the name of the column to sort by, exactly as it appears in the header.
  3. Choose a direction, then click Sort.

Questions

Is my file uploaded anywhere?

No. This page contains the whole tool — the JavaScript that does the work runs inside your browser tab, on your own machine. There is no server to upload to. You can confirm it yourself: open your browser's developer tools, switch to the Network tab, and run the tool. You will not see your file go anywhere. You can also disconnect from the internet after the page loads and it will still work.

Why is 10 sorting before 9?

Because the column is being compared as text, where "10" comes before "9" the same way "ab" comes before "b". Set "Compare as" to Numbers. Automatic detection only picks numeric comparison when every value in the column is a number, so one stray label is enough to make the whole column sort as text.

Where do blank values end up?

At the bottom, in both directions. Blanks aren't meaningfully larger or smaller than anything, and having them sink is more useful than having them lead in one direction and trail in the other.

Do rows stay intact?

Yes. Entire rows move together — this can't produce the classic spreadsheet disaster of sorting one column and detaching it from its data.