Line Sorter & Deduplicator
Alphabetize lists, remove duplicate entries, strip empty lines, and reverse ordering in real-time.
Natural Alphabetical Sorting
Uses internationalized string collation (localeCompare) so alphanumeric items like "Item 2" naturally precede "Item 10".
Deduplication
Instantly scrubs repeated entries from database extracts, keyword lists, or email registries while preserving clean line breaks.
Confidential & Offline
Your data never leaves your browser. Safe for proprietary customer lists, subscriber emails, and internal inventory spreadsheets.
What each sort button does, using the sample list
Start from this list of ten lines, which includes two duplicate fruits and two numbered items. With the default options on, the cleaned list has 8 lines because the repeated Apple and Banana are removed.
Zebra Apple Mango Banana Apple 10 Orange 2 Orange Pineapple Banana Grape
Result (in order): 2 Orange, 10 Orange, Apple, Banana, Grape, Mango, Pineapple, Zebra
What to know: Numbers sort before letters, and 2 comes before 10
Result (in order): Zebra, Pineapple, Mango, Grape, Banana, Apple, 10 Orange, 2 Orange
What to know: The exact reverse of A to Z
Result (in order): Apple, Grape, Mango, Zebra, Banana, 2 Orange, 10 Orange, Pineapple
What to know: By number of characters; ties go alphabetically
Result (in order): 10 Orange, Pineapple, 2 Orange, Banana, Apple, Grape, Mango, Zebra
What to know: Longest line first; ties go alphabetically
Result (in order): Grape, Pineapple, 2 Orange, 10 Orange, Banana, Mango, Apple, Zebra
What to know: Flips the cleaned list as it stands, without sorting it
| Button | Result (in order) | What to know |
|---|---|---|
| A โ Z | 2 Orange, 10 Orange, Apple, Banana, Grape, Mango, Pineapple, Zebra | Numbers sort before letters, and 2 comes before 10 |
| Z โ A | Zebra, Pineapple, Mango, Grape, Banana, Apple, 10 Orange, 2 Orange | The exact reverse of A to Z |
| Shortest first | Apple, Grape, Mango, Zebra, Banana, 2 Orange, 10 Orange, Pineapple | By number of characters; ties go alphabetically |
| Longest first | 10 Orange, Pineapple, 2 Orange, Banana, Apple, Grape, Mango, Zebra | Longest line first; ties go alphabetically |
| Reverse order | Grape, Pineapple, 2 Orange, 10 Orange, Banana, Mango, Apple, Zebra | Flips the cleaned list as it stands, without sorting it |
Natural sorting: why 2 comes before 10
Computers normally sort text letter by letter, which puts "file10.txt" before "file2.txt". This sorter reads numbers inside the text as whole numbers, so a list of file names comes out the way you would arrange it by hand:
file10.txt, file2.txt, file1.txt, file20.txtbecomesfile1.txt, file2.txt, file10.txt, file20.txtv1.10, v1.2, v1.9becomesv1.2, v1.9, v1.10, which suits version-style labels
One limit to know about: a minus sign is treated as punctuation, so negative numbers are not sorted by value. -5, 3, -10, 20 comes out as -5, -10, 3, 20. For a list of numbers that includes negatives or decimals, use a spreadsheet's numeric sort.
The four cleaning options, with examples
Example input: apple, Apple, APPLE, banana
Result: apple, banana
Good to know: Ignores capital letters by default and keeps the first spelling it meets
Example input: apple, Apple, APPLE, banana
Result: apple, Apple, APPLE, banana
Good to know: All four are kept. With duplicates off, sorting b, B, a, A gives a, A, b, B
Example input: apple, "apple " (trailing space), " apple" (leading space)
Result: apple (1 line, 2 duplicates removed)
Good to know: With trimming off, all three count as different lines
Example input: b, (blank), a
Result: a, b
Good to know: With this off, a blank line is kept as an empty line in the result
| Option | Example input | Result | Good to know |
|---|---|---|---|
| Remove duplicate lines | apple, Apple, APPLE, banana | apple, banana | Ignores capital letters by default and keeps the first spelling it meets |
| Case-sensitive sorting (also makes duplicates case-sensitive) | apple, Apple, APPLE, banana | apple, Apple, APPLE, banana | All four are kept. With duplicates off, sorting b, B, a, A gives a, A, b, B |
| Trim extra spaces | apple, "apple " (trailing space), " apple" (leading space) | apple (1 line, 2 duplicates removed) | With trimming off, all three count as different lines |
| Remove blank lines | b, (blank), a | a, b | With this off, a blank line is kept as an empty line in the result |
Trimming, removing blank lines and removing duplicates are on by default, because that is what most lists need. If you only want to sort and keep every line, untick the options you do not want and the result updates at once.
Where a sorted, de-duplicated list helps
- Keyword and tag lists: merge several lists, remove the repeats and spot gaps. For an e-commerce or book listing, see the KDP keyword packer.
- Email and name lists: remove people who appear twice before a mail-out. The matching ignores capitals, so Sam@x.com and sam@x.com count as one.
- File names and version labels: put file1, file2 and file10 in a human order.
- Ranking by length: find the shortest or longest items, such as titles that are too long for a field.
Large lists are fine: 100,000 lines sorted and de-duplicated in about a second or two on an ordinary laptop. Because the work happens on your own device, nothing is uploaded, which matters for customer or subscriber lists. Related: compare two lists with the diff checker, or join lines together with the line break remover.
Frequently Asked Questions
How do I sort a list alphabetically?โผ
Paste one item per line and press A to Z (or Z to A). Sorting uses your browser's language rules, so accented letters sort sensibly and numbers inside text are compared as numbers.
How do I remove duplicate lines?โผ
Tick the option to remove duplicates. Matching is not case sensitive unless you turn on the case-sensitive option.
Can I sort by line length?โผ
Yes. There are buttons for shortest first and longest first, and a button to reverse the current order.
Can it clean up blank lines and extra spaces?โผ
Yes. You can trim spaces from each line and strip empty lines before sorting.
How big a list can it handle?โผ
Lists of hundreds of thousands of lines work, because sorting happens on your own device. Pastes over 200,000 characters are processed after a short pause while you type.
Why does 2 come before 10 here, when other sorters put 10 first?โผ
Plain computer sorting compares text one character at a time, so "10" lands before "2" because 1 comes before 2. This sorter reads whole numbers inside the text as numbers, so "file2.txt" comes before "file10.txt" and "2 Orange" before "10 Orange", which is the order a person expects.
Does it sort negative numbers correctly?โผ
Not by value. A minus sign is treated as punctuation, so -5 comes before -10 instead of after it. Positive whole numbers inside text sort correctly. For a list of numbers that includes negatives or decimals, a spreadsheet's numeric sort is the safer choice.
Which spelling is kept when duplicates differ in capital letters?โผ
The first one in your list. With apple, Apple and APPLE, only apple is kept, unless you tick case-sensitive sorting, in which case all three stay. Words that differ by an accent, such as Zoe and Zoรซ, are treated as different, so both are kept.
Does the sort order depend on my language?โผ
Yes. The order of accented letters follows your browser's language settings, which is what you want for names and words in your own language. For ordinary English letters the result is the same everywhere.
Does it change my original list?โผ
No. Your list stays in the left-hand box exactly as you pasted it, and the cleaned and sorted version appears on the right. Change an option or a sort button and the result updates straight away. Use Copy List to take the result away.