When you sort keywords alphabetically, you expect dictionary order. What you often get is numbers at the top, a keyword with a stray space above everything else, and accented words stuck at the bottom. Sorting is still the quickest way to make a long keyword list readable, as long as you understand what causes those surprises and clean the list where it needs it. This guide shows how to sort in Excel, Google Sheets and a free browser tool, explains why the order sometimes looks wrong, and how to fix it.
I built Keyword Scrubber, the free tool used in this guide, and every result described here was tested against its code in November 2026.
What sorting a keyword list is good for
An unsorted list from a keyword tool, a client or a few copy-and-paste sessions is hard to scan. Sorting it does three useful jobs.
- Near-duplicates end up side by side.
coffee grinderandCoffee Grindermight be 200 rows apart in the original list. After sorting, they’re neighbours, so you can spot them and delete one. - Junk stands out. Lines that start with a space, a number or a symbol such as
#or&collect at the top of the list. Lines that start with an accented letter, a pound sign or a few other characters collect at the bottom. Both ends are worth checking. - Phrases group by their first word. Every keyword starting with
espressoends up in one block, which gives you a rough first pass at topic groups.
The rest of this guide uses one practice list. It’s deliberately messy: it has a leading space, mixed capitals, numbers, accented letters and a duplicate that only differs by case. Copy it and paste it into Keyword Scrubber if you want to follow along.
coffee grinder Espresso machine cafe near me best coffee grinder café near me 10 cup coffee maker 2 cup coffee maker cold brew coffee Coffee Grinder crème brûlée latte caffeine free coffee cafetiere burr coffee grinder cream liqueur coffee espresso machine how to make cold brew
How to sort keywords alphabetically in Excel and Google Sheets
If your list is already in a spreadsheet, sort it where it is. Put the keywords in one column first, with a header row if you like.
Excel
- Select any cell in the keyword column.
- Go to the Data tab and, in the Sort & Filter group, click Sort A to Z.
- If your list has other columns (search volume, for example) and Excel asks, choose Expand the selection so each row stays together.
For more control, click Sort on the Data tab instead. The Sort dialog lets you tick or untick My data has headers, and its Options button has a Case sensitive setting. Excel ignores case unless you tick it. Microsoft’s guide to sorting data in a range or table in Excel covers every option, including the default sort order rules this guide refers to below.
Google Sheets
- Select the whole range you want to sort, including the header row if you have one. Sort range only moves the cells you select, so if your keywords have a search volume column beside them, include it, or the volumes will end up next to the wrong keywords.
- Click Data, then Sort range, then Advanced range sorting options.
- If the first row holds column titles, tick Data has header row.
- Choose the keyword column, choose A to Z, and click Sort.
To sort a whole sheet by one column, right-click the column letter and choose Sort sheet A to Z. Use this only when there’s nothing else on the sheet that needs to stay where it is.
Why the order sometimes looks wrong
Computers don’t sort the way a dictionary does. They compare characters one at a time, from left to right, using rules that differ between programs. Here are the five things that most often make a sorted keyword list look broken.
Capitals
Excel and Keyword Scrubber both ignore case by default, so Coffee Grinder and coffee grinder sort together. Switch case sensitivity on and things change. In Keyword Scrubber, unticking Case insensitive sort puts every keyword that starts with a capital before every keyword that starts with a lowercase letter, so Espresso machine lands above burr coffee grinder. Excel does the reverse when you tick Case sensitive: Microsoft’s guide says lowercase letters sort before their uppercase versions. The simplest fix is to make everything lowercase before you sort.
Numbers sort as text
Inside a keyword, numbers are just characters. 10 cup coffee maker sorts before 2 cup coffee maker because the first character, 1, comes before 2. The tool never reads 10 as a number bigger than 2. Microsoft’s guide gives the same example in Excel’s terms: A100 sorts after A1 but before A11.
There’s no clean fix for this inside keywords, but they all collect in one place, so you can reorder a handful by hand. The same thing can happen to a search volume column imported from a CSV file: if the numbers are stored as text, they sort in text order. Microsoft’s advice is to format the whole column as numbers first.
Leading spaces
A space is a character, and in Keyword Scrubber it sorts before every letter, number and symbol. That’s why best coffee grinder, with its leading space, jumps to the very top of the practice list instead of sitting with the other b words. Exported and pasted lists often pick up stray spaces like this. Microsoft’s guide recommends removing leading spaces before sorting, and in Excel the TRIM function does that for ordinary spaces.
A non-breaking space, which can come along when you copy text from a web page, behaves differently. In Keyword Scrubber, a keyword starting with one sorts after z. Excel’s TRIM function doesn’t remove non-breaking spaces, so in Excel use =TRIM(SUBSTITUTE(A2,UNICHAR(160)," ")) instead, changing A2 to your first keyword cell. In Keyword Scrubber, the Remove leading and trailing spaces button clears both kinds from the start and end of each line.
Accented letters and symbols sort after z
Keyword Scrubber sorts by each character’s code number, the same way a plain JavaScript comparison does. Ordinary letters a to z have low numbers. Accented letters such as é and è, the pound sign £, and curly apostrophes all have higher numbers, so they sort after z. In practice:
café near melands aftercaffeine free coffee, not next tocafe near me.crème brûlée lattelands aftercream liqueur coffeeand any othercrkeyword spelled with plain letters.£50 coffee grindersorts belowzojirushi coffee maker.beginner’s guidewith a curly apostrophe sorts afterbeginners guide, whilebeginner's guidewith a straight apostrophe sorts before it. The same phrase ends up in two places.
Most other symbols, such as #, & and _, sort before the letters. A few, including { and ~, sort after z.
If symbols are the problem, our guide on how to remove special characters from a keyword list covers what to strip and what to keep. Be careful with accented words, though: Keyword Scrubber’s Keep letters and numbers only button removes accented letters entirely, so café becomes caf. To find accented keywords without damaging them, type the letter (for example é) into the Filter box and click Show only lines containing filter. Then decide by hand whether each one should stay accented or be rewritten.
Different tools give different orders
Sort the same list in Excel and in Keyword Scrubber and you can get two different results. According to Microsoft’s guide, Excel puts numbers before the space character and ignores apostrophes and hyphens when sorting, unless two keywords are identical apart from a hyphen. Excel’s sort order also varies with your computer’s locale setting. Keyword Scrubber has none of these rules: space comes before numbers, and apostrophes and hyphens count like any other character. Google’s Sheets help doesn’t set out its sort order rules, so test a small sample before relying on it.
None of these orders is wrong. They just follow different rules. Sort in one tool and stick with it, so the order stays consistent each time you come back to the list.
How to clean and sort keywords alphabetically with Keyword Scrubber
If your list isn’t in a spreadsheet, or you’d rather not open one, Keyword Scrubber does the job in your browser, with the trimming, case change and sort in one place instead of spread across spreadsheet functions. Nothing is uploaded, and there’s nothing to install. Here’s how to clean the practice list and sort it properly.
- Paste your list into the Input box. If the Paste button is blocked by your browser, click in the box and press Ctrl+V (Cmd+V on a Mac).
- Open Character Cleanup and click Remove leading and trailing spaces. The cleaned list appears in the Output box.
- Click Transfer to Input, so the next step works on the trimmed list.
- Open Change Case and click lowercase, then click Transfer to Input again.
- Open Sort, leave Case insensitive sort ticked, and click Sort A-Z.
- Click Copy, or Save to download the result as a text file.
Every cleaning, sorting and filter button reads from the Input box and writes to the Output box, which is why the Transfer to Input steps matter. Skip them and each button works on your original, uncleaned list. Blank lines are dropped automatically whenever you click a button.

With the cleaning steps done first, the practice list sorts like this:
10 cup coffee maker 2 cup coffee maker best coffee grinder burr coffee grinder cafe near me cafetiere caffeine free coffee café near me coffee grinder coffee grinder cold brew coffee cream liqueur coffee crème brûlée latte espresso machine espresso machine how to make cold brew

Two things are worth noticing. best coffee grinder has moved to its proper place among the b words, and the two capitalised keywords have become exact duplicates of their lowercase twins. The free edition of Keyword Scrubber doesn’t remove duplicates, so delete the repeats by hand. Sorting has done the hard part by putting them next to each other.
If your list came from Google Keyword Planner, clean the export first. Our step-by-step guide on how to clean a Keyword Planner export walks through the whole clean-up, from the raw download to a sorted list.
What alphabetical sorting can’t do
Alphabetical sorting only groups keywords by their first word. Look at the sorted practice list: best coffee grinder, burr coffee grinder and coffee grinder are about the same thing, but they’re split across the list because they start differently. The same applies to cold brew coffee and how to make cold brew, which sit at opposite ends of the list.
Sorting, removing duplicates and grouping are three different jobs. Sorting puts lookalikes next to each other, removing duplicates deletes exact repeats, and grouping collects phrases about the same topic. Sorting is only the first pass. To group keywords by topic, you need to look for the shared words anywhere in the phrase, not just at the start. Before you do that, the list needs to be clean, because stray spaces, mixed case and stray symbols will split groups that should be together, in exactly the same way they upset a sort.
You can get part of the way in Keyword Scrubber now: type grinder into the Filter box and click Show only lines containing filter, and every grinder keyword appears together, wherever the word falls in the phrase.
Check the result
Before you use a sorted list, spend a minute on these checks.
- Look at the top. Anything starting with a space, a number or a symbol that sorts before the letters collects here. Leading spaces mean you skipped the trim step.
- Look at the bottom. Anything after the
zkeywords starts with an accented letter, a non-breaking space or an unusual symbol. Decide whether each one is real. - Scan for neighbours that look the same. Exact duplicates and near-duplicates now sit together. Delete the ones you don’t need.
- Count the lines. Keyword Scrubber drops blank lines, so a shorter list is expected if your original had gaps. If far more lines have gone than you expected, check what you pasted.
- Check accented pairs. If you have both
cafeandcaféversions of a keyword, in Keyword Scrubber they won’t be next to each other. Use the Filter box to find them.
Sorting won’t clean or group a list on its own, but it does put the problems where you can see them, and that makes every other cleaning step quicker.
About the author
Glenn Leader is a web publisher and SEO practitioner based in Kent, and has worked online since 2004. He builds the free keyword and text tools here on PhraseFoundry. You can find more of his work at GlennLeader.com.