A mailing list with repeated emails, a keyword list copied from three sources, a log file full of identical entries — duplicates waste time and cause mistakes. This free tool removes duplicate lines from any list in one click, and goes further: sort A–Z or Z–A, sort by length, reverse the order, shuffle, trim extra spaces, remove empty lines and number the lines. Everything runs in your browser, so your list is never uploaded.
How to remove duplicate lines — step by step
- Paste your list. Each item should be on its own line. Press Paste or use Ctrl+V.
- Choose your options. Keep Ignore case ticked if “Email@Example.com” and “email@example.com” should count as the same entry.
- Press Remove duplicates. The first occurrence of each line stays; later repeats are removed. A message shows how many lines were deleted.
- Tidy further if you wish. Sort, trim spaces, remove empty lines or add numbers.
- Copy the result or send it to the notepad. If something looks wrong, press Undo.
What each action does
| Action | What happens |
|---|---|
| Remove duplicates | Keeps the first copy of every line and deletes the rest. The original order is preserved. |
| Sort A → Z / Z → A | Orders lines alphabetically using your page language’s rules. Numbers inside text are compared as numbers (1, 2, 10). |
| Sort by length | Shortest line first; lines of equal length are sorted alphabetically. |
| Reverse order | Flips the list upside down. |
| Shuffle | Puts the lines in random order — useful for draws and quizzes. |
| Trim spaces | Removes spaces and tabs at the start and end of each line, and turns repeated inner spaces into one. |
| Remove empty lines | Deletes blank lines, including lines that contain only spaces. |
| Number lines | Adds 1., 2., 3. in front of each line (with leading zeros when the list is long, such as 01., 02.). |
Why “Ignore case” and trimming matter
Computers compare text character by character, so lines that look the same to you can be different to the program: “Apple” and “apple” differ by one capital letter, and “apple” and “apple ” (with a trailing space) differ by an invisible space. Lists copied from emails, spreadsheets and web pages often contain such invisible differences. That is why the best order is usually: Trim spaces → Remove duplicates. If you want a case-sensitive comparison — for instance, a list of passwords or product codes where capitalisation matters — untick Ignore case before removing duplicates.
Natural sorting and language rules
A basic alphabetical sort puts “item 10” before “item 2”, because the character “1” comes before “2”. This tool uses natural sorting, so numbers inside text are compared as numbers: item 1, item 2, item 10. Letters with accents are placed according to the language of the page, so in French or Spanish “é” sorts next to “e”, not after “z”. Sorting is useful for word lists, name lists, glossary entries and anything you will search through later.
Practical examples
Cleaning an email or contact list
Combine addresses from several sources, trim spaces, remove duplicates with Ignore case on, and sort A → Z to spot typos.
Keyword research and SEO lists
Paste keywords from different tools, remove repeats, and sort by length to find short head terms and long-tail phrases. Then use the Word Counter to check title and description lengths.
Student and teacher tasks
Remove repeated vocabulary words, shuffle quiz questions, and number the lines to make a worksheet.
Logs, IDs and data exports
Reduce a long list of IDs to unique values before importing them. For tabular data, finish by converting the list in the Text to Excel tool.
Giveaways and random draws
Paste participant names, remove duplicates, and shuffle. The first line after shuffling can be your pick — or use the numbered list to choose.
Shopping and to-do lists
Merge lists from family members and drop the repeated items.
A worked example: cleaning a keyword list
Imagine you collected keywords from three research tools and pasted them together. The list contains “Online notepad”, “online notepad ”, “free notepad online”, “Online Notepad”, an empty line, and “free notepad online” again. First press Trim spaces: the trailing space after the second entry disappears. Then press Remove empty lines. Now press Remove duplicates with Ignore case ticked: the three versions of “online notepad” collapse into one, and the second “free notepad online” is dropped. The tool reports how many lines were removed, so you can sense-check the result. Finally, press Sort by length to separate short head terms from longer phrases, and copy the cleaned list. The whole process takes about ten seconds and avoids opening a spreadsheet.
The same recipe works for email addresses (trim, remove duplicates, sort A → Z), for names in a class register, and for product SKUs. If you need to keep a record of what was removed, copy the original list to the notepad before you start, so you can compare the two versions later.
Duplicate lines vs. duplicate rows in a spreadsheet
Spreadsheets can also remove duplicates, but they work on cells or whole rows and usually need a file to be imported first. A line-based tool is faster when your data is a simple list copied from a document, an email or a web page. If your data has several columns and you want to remove rows that are identical in only one column, convert it to a spreadsheet with the Text to Excel tool and use the spreadsheet’s “Remove Duplicates” feature. For everything else — quick clean-ups, merging lists and preparing text for import — working line by line is simpler and keeps your original order.
Tips for reliable results
- One item per line. If your items are separated by commas, convert them to separate lines first (replace commas with line breaks in the notepad’s Find & Replace).
- Trim before you dedupe to catch invisible differences.
- Check Windows and Mac line endings. Both are handled; empty trailing lines are removed automatically.
- Keep a copy of the original until you are happy. Undo helps within the page, but reloading starts fresh (although the box content is restored from your browser).
- Use the line counter. The number beside the toolbar tells you how many lines you have before and after each action.
- Combine actions. A common sequence: Trim spaces → Remove empty lines → Remove duplicates → Sort A → Z.
Limits of this tool
This tool compares whole lines. It does not detect lines that are similar but not identical (for example “colour” and “color”), and it does not remove duplicate words inside a line. It also treats each line as plain text: it does not understand columns in a CSV file. For comparing two lists, or for finding duplicates in one column of a spreadsheet, use a spreadsheet’s duplicate features. For very large lists (hundreds of thousands of lines), the speed depends on your device, since all the work is done locally.
Privacy
Your list is processed in your browser and is not sent to TextAgo. To prevent loss of work, the latest text is stored in your browser’s local storage and shared with a few other TextAgo text tools on the same device. Clear it with the Clear button or by clearing your browser data. For details, read our Privacy Policy.
Troubleshooting
Duplicates are not being removed
The lines probably differ by an invisible space or capital letter. Press Trim spaces, make sure Ignore case is ticked, and try again.
The order changed unexpectedly
You may have pressed a sort button. Press Undo to restore the previous order.
Numbers are in an odd order
If you see 1, 10, 2 it means the numbers are part of longer text with different prefixes. Natural sorting compares matching text first and then the numbers.
My list is all on one line
Your items are separated by something other than line breaks. Replace the separator with line breaks first.
Frequently asked questions about removing duplicate lines
How do I remove duplicate lines from a text file?
Open the file in a text editor, copy everything, paste it here, press Remove duplicates, and copy the result back.
Does it keep the original order?
Yes. Removing duplicates keeps the first copy of each line in its original position.
Is it case-sensitive?
Only if you untick Ignore case. By default, “Apple” and “apple” are treated as duplicates.
Can I sort a list alphabetically?
Yes. Use Sort A → Z or Sort Z → A.
Is there a limit on the number of lines?
TextAgo sets none. Performance depends on your device.
Is my data safe?
The tool runs in your browser and does not upload your list.