All posts

How to Sort a CSV by a Column (Text, Natural Order or Number)

··3 min read

To sort a CSV by a column, choose the column, choose whether to read it as text or as a number, and choose the direction. The sort CSV by column tool does this in your browser: the header stays on top, blank cells go last and every other column stays with its row.

The part that trips people up is how the column is read.

Why 10 sorts before 9

Compared as text, cells are read character by character, so 10 comes before 9 because 1 comes before 9. The same happens with A10 and A2. This is the right order for names, and the wrong one for amounts, counts or IDs with numbers in them.

The tool offers three ways to read a column:

Read as Order you get Good for
Text 10, 2, 9, A10, A2 Names, plain words
Text with numbers in order 2, 9, 10, A2, A10 IDs, codes, addresses with numbers
Number 120, then 1,250 Counts, prices, headcount

A number sort ignores commas, spaces and the signs $, £ and €. A cell that cannot be read as a number is placed after the numbers and counted, so you can see what failed.

Step 1: do it by hand

In Excel, select the data, choose Data, Sort, pick the column, and tick that your data has headers. Excel reads a column of numbers stored as text in text order, which is why a column imported from a CSV can sort wrongly until it is converted. Check that the whole table is selected, or the sorted column will separate from the rest of its rows.

Step 2: use the tool

  1. Upload the CSV or .xlsx, or paste the cells with the header row first.
  2. Choose the column to sort by.
  3. Choose how to read it and the direction.
  4. Download the sorted list.

Upper and lower case are treated the same, so apple and Apple sort together. Rows with equal values keep the order they had in the file.

Sorting by two columns

The tool sorts one column per pass. Because equal values keep their order, you sort by the second column first, download the result, load it and sort by the first. The rows then come out grouped by the first column and ordered by the second inside each group.

Dates

Dates sort correctly as text only when written year first, such as 2026-11-10. That is the ISO 8601 order, where each unit is smaller than the one before it. A date like 10/11/2026 sorts by its day. To rewrite a date column first, see CSV dates and the day and month order.

What this cannot do

  • It sorts one column at a time.
  • Text sorting follows English collation and may place some accented letters differently from another language's rules.
  • Dates in other formats do not come out in order.
  • Only the first sheet of a workbook is read.

To sort addresses by domain or mailbox provider, use the email list sorter. For a checklist, see clean your list before a campaign.

Verify the list once it is in order

Upload the sorted list on the verify page: the first 100 email checks are free with a Google sign-in, no card. Each address comes back valid, risky or invalid with a reason, and nothing is sent to anyone on the list. For larger or recurring lists, see bulk email verification, list cleaning and pricing.

Sort your file now

Upload it to sort CSV by column.

Common questions

How do I sort a CSV by one column?

Pick the column, choose how to read it (text, natural text or number) and the direction, and write the rows out in that order. Excel does it with Data, Sort.

Why does 10 come before 9 in my sort?

Text is compared character by character, and 1 comes before 9. Sort the column as numbers, or in natural order, to get 9 before 10.

How do I sort by two columns?

Sort by the second column first, then by the first, as long as equal values keep their order. A tool that sorts one column per pass works this way.

How do I sort dates in a CSV?

Dates written year first, such as 2026-11-10, sort correctly as text. Other formats do not, so convert them first.

Where do blank cells go?

Blanks usually go last in either direction, so the rows with values are together at the top.

Check your list before you send

Real mailbox checks over SMTP, and nothing is sent to the address. Sign in with Google and your first 100 email checks are free, no card. Plans for bigger lists are on the pricing page.