What this tool does
Sort and dedupe lines takes any list of text —one item per line— and cleans it up in seconds: it alphabetizes the lines, drops the duplicates, removes blank rows, trims stray spaces, and, when you want it, shuffles the order at random. It is the kind of chore that takes several clicks in a spreadsheet and here comes down to pasting your text and pressing a button.
It fits a lot of everyday jobs: alphabetizing a list of names or countries, tidying a column of email addresses, de-duplicating exported data, cleaning a messy paste with trailing spaces on every line, or shuffling entrants for a giveaway. Everything happens inside your browser — your text is never uploaded.
How to use it
- Paste or type your text in the first box, with one item per line.
- Pick an order: keep the current one, A → Z, Z → A, reverse (flip the list as it stands), or shuffle at random.
- Tick the clean up boxes you need: trim extra spaces, remove empty lines, or remove duplicates.
- If upper- and lowercase should count as different, turn on Case sensitive.
- Press Apply. The result shows below, and the counter tells you how many lines you started with, how many remain, and how many were removed. Copy with one click.
Alphabetical order that respects accents
Sorting uses localeCompare, the language-aware way to compare strings. This matters well beyond English: a naive sort by character code pushes every accented word to the very end, after z. With localeCompare, árbol sits next to arbol and letters like ñ land where a dictionary would put them, between n and o.
By default sorting is case-insensitive, so Banana and banana are treated as equal when ordering. Turn on Case sensitive to separate them.
Worked example
Paste this seven-line list (note the duplicate, the blank line, and the stray spaces around grape):
pear
apple
Banana
cherry
apple
grape
With A → Z, trim spaces, remove empty, and remove duplicates all switched on, the result is five lines:
apple
Banana
cherry
grape
pear
| Step | Lines | What happened |
|---|---|---|
| Input | 7 | original text |
| Remove empty | 6 | blank line dropped |
| Remove duplicates | 5 | the second apple went |
| Sort A → Z | 5 | apple first (case-insensitive) |
Frequently asked questions
Is sorting case-sensitive?
Not by default: Banana and banana are treated as equal both when sorting and when removing duplicates. Tick Case sensitive to treat them as different — then both versions are kept and the order separates upper- from lowercase.
How do I remove repeated lines?
Turn on Remove duplicates and press Apply. The first occurrence of each line is kept and the later copies are dropped. Combine it with Trim extra spaces and two lines that differ only by leading or trailing whitespace count as identical too.
Can I sort numbers correctly?
The tool sorts as text, not as numbers. That means 10 comes before 2, because it compares character by character and 1 precedes 2. To order figures by their numeric value, use a spreadsheet; here the order is alphabetical, which is exactly what you want for words, codes, and mixed lists.
Is my text stored or sent anywhere?
No. All processing runs in your browser with JavaScript; nothing travels to a server. Close the tab and no trace is left behind.