← All postsPerson using Text Sorter on a laptop for a real list hygiene task

Clean and Sort a Keyword List: Dedupe, Natural Order, Undo

Sort and de-duplicate a pasted keyword list, including mixed case, accents and numbers, before it goes into a content plan.

sort lines alphabeticallyremove duplicate lineskeyword list cleanupnatural sortsort by lengthcontent planningtext toolsbrowser tools
5 min readText & Writing

Keyword exports arrive in the order the research tool felt like: three copies of the same phrase in different capitals, a stray blank line, a leading space that makes one entry sort to the top. Pasted into a planning sheet as is, that mess leads to two writers claiming the same topic. Text Sorter puts one item per line into order and strips the junk in a single pass.

Quick answer: paste the list, set the switches, then press Sort Alphabetically, Sort by Length, Shuffle or Clean only (keep order). The result replaces the text in the same box, a one-line summary says how many lines were removed, and Undo restores the previous version once. Everything is processed in your browser.

The clip below shows lines being sorted alphabetically or by length.

How to Sort Text Lines Alphabetically or by Length

How to Sort Text Lines Alphabetically or by Length

The messy list, and what the switches change

Here is a 14-line paste from a research session. Line 3 starts with two spaces, line 6 is blank, and a few lines repeat:

seo audit checklist
SEO Audit Checklist
  keyword research tool  
best seo tools 2026
seo tools 10 ranked

seo tools 2 compared
Backlink checker
backlink checker
résumé keywords
resume keywords
title tag length
meta description length
seo tools 10 ranked

With the defaults (Ignore case on, Natural numbers on, Trim spaces on, Remove blank lines on, Remove duplicates off), Sort Alphabetically reports 14 lines becoming 13, because only the blank line goes. Duplicates stay. Switch on Remove duplicates and run again from the original paste: 14 become 10 and the summary shows 4 removed. The kept copies are the first occurrences, so "seo audit checklist" survives and "SEO Audit Checklist" is dropped, and the first "Backlink checker" survives with its capital B.

Turn Ignore case off and tick Remove duplicates, and only the exact repeat of "seo tools 10 ranked" is dropped, leaving 12 lines. In that mode capitals sort before their lowercase twins, so "SEO Audit Checklist" appears just before "seo audit checklist".

Reading the options in order

  1. Paste one item per line. Windows and Mac line endings both work.
  2. Reverse (Z to A) flips the final order. It has no effect on Shuffle.
  3. Ignore case treats a and A as equal for sorting and for duplicate matching.
  4. Natural numbers compares digits by value, so "seo tools 2 compared" lands before "seo tools 10 ranked". Switched off, the character comparison puts the 10 first, because 1 comes before 2.
  5. Trim spaces removes leading and trailing spaces from every kept line, which also makes the indented "keyword research tool" sort where it belongs.
  6. Remove blank lines drops empty rows. Remove duplicates keeps the first copy.
  7. Press the action button. Use Copy Result to copy the new text and Undo if you do not like the outcome.

Sort by length, and why it helps keyword work

Sort by Length puts the shortest lines first and orders equal lengths alphabetically. On the cleaned list the top two entries are the two 15-character lines "résumé keywords" and "resume keywords", then "Backlink checker" and "title tag length". Reverse then gives the longest phrases first, which is a quick way to spot long-tail keywords for headings, or over-long titles that will be cut off in search results. Pair it with the Word Counter when you need exact counts for a character limit.

Accents and what duplicates really mean

The accent behaviour deserves attention. With Ignore case on, sorting compares letters at their base level, so "résumé keywords" and "resume keywords" sort side by side and count as equal in the ordering. Duplicate removal, however, only lowercases and normalises the text; it does not strip accents. In the example, both versions survive the dedupe, and you have to decide which spelling to keep yourself. With Ignore case off, the unaccented version sorts first, followed by the accented one.

Similar near-duplicates the tool will not catch: plural versus singular, a trailing question mark, a hyphen in one version. For those, normalise with Find and Replace first, then sort.

Clean only: when order matters

Sometimes the order is meaningful, such as a ranked list from a rank tracker, and you only want it tidier. Clean only (keep order) applies Trim spaces, Remove blank lines and Remove duplicates as ticked, and leaves everything else where it is. On the sample list it returns 10 lines starting with "seo audit checklist" and ending with "meta description length", the same as the original sequence minus the repeats. Tick Reverse and it simply flips that list.

Shuffle for fair assignment

Shuffle randomises the order on each press. It is useful for handing out writing topics without bias: shuffle, then give the first five lines to the first writer. It is a plain random shuffle, not a seeded one, so you cannot reproduce a particular order later. Copy the result if you need a record.

Mistakes to avoid

  • Pressing buttons repeatedly without saving. Undo only goes back one step, so copy a clean version to your sheet before you experiment.
  • Pasting comma-separated text. The tool works line by line; a single line of comma-separated keywords is one item. Replace the commas with line breaks in Find and Replace first.
  • Sorting a table. If a keyword and its volume are separated by a tab in one line, the sort treats the whole line as text and orders by the keyword first, which is fine, but trimming spaces can disturb alignment.
  • Assuming the dedupe is global across files. It works on the text in the box only.

Where it fits in a content plan

After cleaning, check how often a chosen phrase actually appears in a draft with Keyword Density. For list jobs with reversing or word-level dedupe, our walkthrough of the text reverser covers those buttons. The text tools category has more. Each action press uses one of your 10 trial usages a day, so check the switches before you press.

Do your lists come from a rank tracker, a spreadsheet or a brainstorming session? Tell us on the contact page, and we will tailor the next cleanup guide.

Open Text SorterOpen Keyword Density CheckerOpen Find & ReplaceOpen Word & Character Counter