Skip to content
TextBench Lab

Productivity

How to Clean a Keyword List Before You Use It

Published 5 min read

On this page
  1. What is usually wrong with a raw keyword list?
  2. What does the list look like before and after?
  3. How do you clean the list step by step?
  4. Why does the order of the steps matter?
  5. How can you see which keywords were repeated?
  6. What can this routine not do for you?
  7. How do you keep a record of what changed?
  8. Keyword list clean-up: short answers

To clean a keyword list, work in a fixed order: count it, lowercase it, trim spaces and drop blank lines, remove duplicates, sort it A to Z, then count it again. Doing it in that order turns near-duplicates such as Running Shoes and running shoes into exact matches before they are removed, so nothing slips through. The whole routine takes a few minutes with three free tools that run in your browser.

Below, a messy 12-line sample goes through each step, with the real numbers the tools show, so you can follow along and check your own list the same way.

What is usually wrong with a raw keyword list?

Keyword lists are built by copying terms from spreadsheets, notes, exports and brainstorms. The result almost always has the same four problems:

  • Mixed capitals: Running Shoes, running shoes and Running shoes.
  • Stray whitespace: spaces or tabs at the start or end of a line.
  • Blank lines, including lines that contain only spaces.
  • Repeated terms, often in several of the forms above.

Here is the sample used in this guide:

Running Shoes
  running shoes
trail running shoes

Running shoes 
best running shoes
Trail Running Shoes
running socks
  
best running shoes
Running Socks
running shoes for women

To a person there are five keywords here. To a computer comparing lines, there are many more.

What does the list look like before and after?

MeasureBeforeAfter
Lines with text105
Words2614
Blank lines20

The rest of this guide shows how to get from the first column to the second.

How do you clean the list step by step?

1. Count it first. Paste the list into the word counter to count the words and lines. The sample shows 26 words and 10 lines. The word counter counts only lines that contain text, so the two blank lines are not included. Note the figures; they are your baseline.

2. Lowercase everything. Paste the list into the case converter and choose lowercase, which lets you lowercase everything in one click. Now Running Shoes and running shoes are identical. The counts do not change yet. If capitals matter, for example in brand names, skip this step and tick Ignore case in the next one instead; the tool then keeps the first spelling it finds.

3. Trim, drop blanks and remove repeats. Paste the lowercase list into the duplicate line remover and tick Trim whitespace on each line and Ignore empty lines. The statistics show 12 lines in, 5 lines out and 5 duplicates removed. The other two missing lines were blank: 12 minus 5 repeats minus 2 blanks leaves 5.

4. Sort A to Z. In the same tool, set Sort to A to Z, so you drop repeated keywords and sort the list in a single pass:

best running shoes
running shoes
running shoes for women
running socks
trail running shoes

5. Count it again. Paste the clean list back into the word counter: 14 words and 5 lines. Compare these with your baseline.

Why does the order of the steps matter?

Each step prepares the next. Lowercasing and trimming make near-duplicates identical, so the duplicate check can find them. Removing repeats before sorting means fewer lines to sort and read. Counting at both ends gives you proof that the list shrank for the right reasons.

If you change the order, for example removing duplicates before trimming, running shoes with its trailing space survives as a separate keyword, and you only notice when the numbers do not add up.

How can you see which keywords were repeated?

Before you sort, tick Show only duplicated lines in the duplicate line remover. For the sample it lists four terms, each once: running shoes, trail running shoes, best running shoes and running socks. That tells you which terms were collected more than once, which can hint at what your sources have in common. Untick it again to get the full clean list back.

What can this routine not do for you?

It tidies text. It does not judge which keywords are worth targeting, and it does not merge terms that only mean the same thing:

  • running shoes and running shoes for women are different phrases, so both stay.
  • Word order matters: shoes running is a different line from running shoes.
  • Singular and plural, such as running shoe and running shoes, stay separate.
  • Typos stay too. Sorting puts similar terms next to each other, which makes them easier to spot by eye.

If your list holds email addresses instead, the same steps apply with one extra question about capital letters; see removing duplicate emails.

How do you keep a record of what changed?

Save the raw list in a separate file before you start. The tools store nothing, so closing the tab loses the text. With both versions saved, you can check every removed line, for example by comparing the list before and after cleaning.

Keyword list clean-up: short answers

How do I remove duplicate keywords from a list?

Paste the list into a duplicate line remover, tick trim whitespace and ignore case, and copy the result. The first copy of each keyword is kept.

How do I sort a keyword list alphabetically?

Set Sort to A to Z in the duplicate line remover. Choose Z to A for reverse order, or Keep original order to leave it as it is.

Should keywords be lowercase?

For a working list, lowercase makes matching and sorting simpler. Keep capitals only where they carry meaning, such as brand names.

How do I remove blank lines from a list?

Tick Ignore empty lines. It removes empty lines and lines that contain only spaces.

How many keywords can I clean at once?

The duplicate line remover takes up to 1,000,000 characters and 100,000 lines. Split larger lists into parts.

Related tools