Line Sorter & Deduper
Sort a list of lines alphabetically or by length, and optionally strip duplicates.
5 lines in → 4 lines out · 1 duplicate removed
This tool reorders a list of lines and cleans it up. Paste one item per line and choose a sort order — A→Z, Z→A, by length, or reverse. Optional toggles remove duplicate lines, ignore letter case, trim whitespace, and drop blank lines. A live count shows lines in, lines out, and duplicates removed.
What it does
Each line of your input is treated as one item. The tool applies your chosen sort order and any cleanup toggles, then shows the result ready to copy. A→Z and Z→A order the lines alphabetically, By length puts the shortest lines first, and Reverse simply flips the current order without sorting. Turn on Remove duplicates to keep only the first copy of each repeated line, Case-insensitive to treat Apple and apple as the same, Trim whitespace to strip leading and trailing spaces, and Remove blank lines to delete empty rows.
How the ordering works
Sorting uses locale-aware comparison, so accented and mixed-case words land where a reader expects rather than in raw byte order. When Case-insensitive is on, comparison and duplicate matching both ignore letter case. Cleanup runs before sorting: lines are trimmed, blanks are dropped, duplicates are removed keeping the first occurrence, and only then are the survivors put in order.
- 1 Paste one item per line. For example the five lines: banana, apple, cherry, apple, date — that is 5 lines in.
- 2 Pick a sort order. Choose A→Z, Z→A, By length, or Reverse. A→Z uses locale-aware alphabetical order.
- 3 Turn on Remove duplicates. The second “apple” is dropped and the first is kept, so 1 duplicate is removed.
- 4 Set the matching options. Case-insensitive treats “Apple” and “apple” as equal; Trim whitespace and Remove blank lines tidy stray spaces and empty rows.
- 5 Read the result and copy. A→Z gives apple, banana, cherry, date — 5 lines in → 4 lines out · 1 duplicate removed. Use Copy lines to grab it.
Sort orders and options
What each control does to your list.
| Control | Effect |
|---|---|
| A → Z | Sorts lines alphabetically, ascending, using locale-aware comparison. |
| Z → A | Sorts lines alphabetically in reverse (descending). |
| By length | Orders by character count, shortest first; ties broken alphabetically. |
| Reverse | Flips the current line order without sorting. |
| Remove duplicates | Keeps the first occurrence of each repeated line and drops the rest. |
| Case-insensitive | Ignores letter case when sorting and when matching duplicates. |
| Trim whitespace | Strips leading and trailing spaces and tabs from every line. |
| Remove blank lines | Deletes empty lines from the output. |
Where it helps
Cleaning lists. Turn a messy bullet dump, reading list, or set of names into a tidy, ordered, duplicate-free list. CSV columns. Paste one column of exported data, sort it, and strip repeats before pasting it back. Keyword lists. SEO and research keyword sets often arrive with duplicates and inconsistent case — case-insensitive dedupe collapses them, and A→Z makes scanning easy. Because the tool works line by line, anything you can put one-per-line — tags, emails, imports, to-do items — sorts and dedupes the same way.