Sort Lines Alphabetically and Delete Duplicates
Put a list in A-Z order and delete duplicate lines in one pass — the list never leaves your device
Your data stays with you. Conversion happens inside the browser; nothing is sent to a server.
Did this tool do the job?
Thanks, your feedback came through.
How it works
Paste your list into the left box; the result appears in the right box as you type. A 120-name guest list is alphabetized instantly, and accented letters land next to their base letters — 'Éclair' sorts with the E entries instead of being dumped at the end the way byte-order tools do. Duplicate lines are deleted according to your setting and the status line reports how many were removed, so you can paste two lists on top of each other and weed out the shared entries in one pass. For file names and anything else containing numbers, switch to natural number order: file2 correctly comes before file10, chapter9 before chapter10. Empty lines are dropped automatically and invisible spaces at the start or end of a line are ignored during comparison, which is exactly where most 'why wasn't this duplicate caught' surprises come from. Copy the output with one click or download it as a text file.
This tool is also known as sort lines alphabetically, alphabetize a list online, remove duplicate lines, sort list a to z, natural sort file names.
What is Alphabetical sorting (collation)?
Alphabetical sorting arranges lines by the letter order of a language, comparing two lines at their first differing character. The subtle part is what 'letter order' means: proper collation treats uppercase and lowercase as the same letter and files accented characters next to their base form, so 'apple', 'Apple' and 'éclair' all land where a reader expects them. Tools that compare raw character codes instead produce the classic failure — every capitalized word first, accented words last — which is invisible in short lists and embarrassing in printed ones.
What is Duplicate line?
A duplicate line is an entry that appears more than once in a list. It usually arrives by pasting two lists together, exporting the same records twice, or copying a block one extra time. Removing duplicates forces two decisions: do surrounding spaces count, and is letter case a difference? This tool always ignores leading and trailing spaces, and lets you choose about case — 'US' and 'us' may be the same organisation in one list and two different words in another, so no single default fits every job.
What is the difference between alphabetical and natural sort order?
Alphabetical order compares digits like letters, from left to right: 'file10' sorts before 'file2' because the first differing character is 1 versus 2 — yet every reader knows 2 is smaller than 10 and reads the list as broken. Natural sort order reads digit groups inside a line as whole numbers: file2 before file10, chapter9 before chapter10, version 2.9 before version 2.10. Choose natural order for anything carrying numbers — file names, chapter titles, class codes like 10-A. For lists without digits the two orders produce identical results, so natural order is never the wrong choice; it is simply unnecessary.
Why do some tools sort 'apple, Banana, cherry' wrong?
Every character has a code number, and in that raw numbering all capital letters come before all lowercase ones — a tool that compares code numbers instead of letters will sort 'Banana' before 'apple' and push 'éclair' past 'zebra'. Spreadsheets with the wrong locale and many quick online sorters do exactly this, and in a long list the damage hides until someone reads the printout.
This tool compares lines with proper English collation: case does not split the alphabet in two, and accented characters sort next to their base letter. Leading and trailing spaces are ignored while comparing, so an entry pasted with a stray space still finds its correct neighbours.
Which setting for which job?
Sorting and duplicate removal are independent — use them together or on their own.
- Guest, student or mailing list → A → Z + exact-match delete
- Merging two lists and removing shared entries → no sorting + ignore case
- File or chapter names (part1, part10) → natural number order
- Lines ending in scores or dates → Z → A to float the newest/highest to the top
Frequently asked questions
How are duplicate lines detected?
Lines are compared with leading and trailing spaces ignored. 'Delete — exact' requires identical spelling; with 'ignoring UPPER/lower case' selected, 'APPLE' and 'apple' count as the same line and the first occurrence is kept.
Can I remove duplicates without changing the order?
Yes. Set the sort order to 'No sorting' — lines stay in their original order and only repeats of an earlier line are deleted. The status line tells you how many were removed.
What does natural number order do?
It reads digit groups inside a line as numbers instead of characters, so file2 sorts before file10 and chapter9 before chapter10. Plain alphabetical order would put file10 first because it compares digit by digit.
Is my list sent anywhere?
No. Sorting and deduplication run entirely inside your browser; the list never leaves this page and is not sent to any server or third party.