All free toolsUtilities

Strip duplicates, sort alphabetically/naturally, trim, and filter text lines.

17free utilities

Local processing limits: 50 MB per file, 20 files and 100 MB per selection. Some tools have stricter limits. Large or complex files can still exceed device memory.

Your files stay private·Nothing is stored or retained
Free, no sign-up·No watermark

Lines

⬆
Drop a text file or paste below
Accepted: .txt, .csv, .md

Result

3 duplicate line(s) removed.

Processing and privacy: Duplicate Line Remover & Sorter

File processing runs in your browser. Your selected file is not uploaded by this tool. The website still receives ordinary page and asset requests. Keep your browser updated and review the output before sharing it.

File sizes and processing time depend on the tool and your device. Safety limits may apply; unlimited file sizes and instant completion are not guaranteed.

Complete Master GuidePublished by Cortexis Solution Hub Pvt Ltd Document Research Lab • 9 min read

How to Remove Duplicate Lines and Sort Lines Alphabetically: Clean Any List in Seconds

A mailing list pasted together from three exports. A keyword sheet where one phrase appears with different capitals. A column of URLs full of blank rows. The job is the same: every entry once, in a sensible order, without opening a spreadsheet. This guide shows how to remove duplicate lines, remove duplicates from a list and sort lines alphabetically with a free duplicate line remover, explains exactly what counts as a duplicate, and names the jobs another tool does better.

A handwritten shopping list on a lined notepad with a green pen, one item per line
Paste a list, press one button, copy the result. Fourteen one-click actions for deduping, sorting and tidying lines.

1. What Counts as a Duplicate Line

Many pages that remove duplicate lines never say what “duplicate” means, which is why the results so often surprise people. Here it is decided by three checkboxes above the buttons, and all three start switched on.

Case-insensitive

Apple, apple and APPLE count as the same line. Switch it off when capitals carry meaning, as in product codes.

Trim whitespace first

Spaces and tabs at the start and end of each line are ignored, so "date" and " date " match. Switch it off to keep indentation.

Keep first occurrence

When a line repeats, the first copy stays in its original position. Untick it to keep the last copy instead, useful when later entries are newer.

Matching is always of whole lines, after those rules apply. Blank lines count too, so several empty rows collapse into one; press Remove empty lines if you want none. Removing duplicates never sorts your list.

2. How to Remove Duplicate Lines in a Text File

Here is how to remove duplicate lines in a text file or a pasted block: the quickest way to remove duplicate lines online free.

  1. Add your text. Paste it into the box, or drop a .txt, .csv or .md file onto the panel. Windows and Unix line endings both work.
  2. Check the three options. The defaults (ignore case, trim spaces, keep the first copy) suit most lists.
  3. Press Remove duplicates. The cleaned list appears in the Result pane with a note such as “3 duplicate line(s) removed.”
  4. Copy or download. Use Copy to paste it elsewhere, or Download to save it as lines.txt.

A one-column CSV works the same way, an easy route to unique lines from a CSV file. With several columns, rows match only when every field matches; see section 6.

3. Sort Lines Alphabetically, Naturally or by Number

If you are wondering how to sort a list alphabetically without Excel or Word, paste it and press Sort A → Z, or Sort Z → A for the reverse. That is all it takes to alphabetize a list online. The comparison respects accented letters and, with case-insensitive on, treats capitals and lower case alike. But this sort text lines online tool offers five orderings, because alphabetical order is not always what you mean. Take four lines, 10, 9, 100 and apple:

ButtonResultUse it for
Sort A → Z10, 100, 9, appleNames, words, plain text
Natural sort9, 10, 100, appleFilenames, versions, chapters
Numeric sortapple, 9, 10, 100Lines that start with a number
Sort Z → Aapple, 9, 100, 10Reverse alphabetical lists
Sort by length9, 10, 100, appleGrouping short and long entries

That first row is the sort numbers 10 before 2 problem: alphabetical order compares character by character. Natural sort reads runs of digits as whole numbers, so it is the one to use to natural sort filenames online: file2 lands before file10. Numeric sort reads only the number at the start of each line, including decimals and negatives; a line that does not begin with a number counts as zero, which is why apple jumps to the top.

Finally, Sort by length lets you sort lines by length, shortest first, with ties broken alphabetically: handy for separating short and long-tail keywords.

4. Why Duplicate Lines Were Not Removed

Two lines look the same but both survive? There are three common causes, and each has a fix here.

  • Capitals differ. If you need to remove duplicates, ignore case differences and leave the Case-insensitive box ticked. It is on by default here, so there is nothing to remember to switch on.
  • Hidden spaces. The case of duplicate lines not removed because of trailing spaces is the most common one of all: a space or tab at the end of one copy makes it a different line. Trim whitespace first handles this, and Trim lines on its own cleans every line whatever the checkbox says.
  • The wrong copy was kept. Duplicates were removed, but you wanted the newest entry. For keep last occurrence, remove duplicates with the Keep first occurrence box unticked; each surviving line then sits where its last copy was.

Used to doing this with a text editor plugin or a macro? This page gives the same result, and the three switches make the matching rules visible instead of buried in a settings menu.

5. Shuffle, Reverse, Number, Join and Count

The other buttons cover the jobs that usually send people to a spreadsheet.

  • Shuffle. Use it to randomize list order online, whether you need to shuffle a list of names for a random order of presentations or a prize draw. Press again for a new order.
  • Reverse order. The answer to how to reverse the order of lines: the last line comes first, flipping a log without sorting it.
  • Number lines. The easy way to add line numbers to text online: each line gets “1. ”, “2. ” and so on, padded so the numbers stay aligned past line 9.
  • Add prefix/suffix. Type text into the Prefix and Suffix fields to add a prefix and suffix to each line: quotes around every value, a domain in front of every path, a comma after every entry.
  • Remove empty lines. Deletes blank and whitespace-only rows when you just need to remove empty lines online.
  • Join with commas. Here is how to convert a list to comma separated text: the non-empty lines become one line, separated by a comma and a space.
  • Count occurrences. This is how to count duplicate lines: each distinct line is listed once after a count and a tab, most frequent first. With case-insensitive on, lines are shown in lower case.

Developers will recognise this as sort | uniq -c, so this page doubles as Linux sort uniq online. One difference is worth knowing: as the GNU uniq manual explains, uniq only merges adjacent repeats, so it needs sort first. Remove duplicates finds repeats anywhere in the list, with no sorting step.

6. Emails, Keywords, URLs, and What It Cannot Do

To remove duplicate emails from a list before an import, keep case-insensitive on, since in practice mailbox providers generally treat capitals in addresses as the same. To remove duplicate keywords from a list, the defaults are right too. To remove duplicate URLs from a list, think before ignoring case, because URL paths can be case-sensitive; untick the box if both versions should stay.

Each button starts from the input box, not the previous result. To dedupe then sort, press Remove duplicates, copy the result back into the box, then press a sort. Here is what the tool does not do, and where to go instead.

  • Compare two lists to find lines in one but not the other: use the diff checker.
  • Filter by keyword or pattern, or find and replace inside lines: build and test the pattern in the regex tester.
  • Sort or dedupe by one column of a CSV: this tool works on whole lines, so use the CSV to JSON converter or the spreadsheet converter for column work.
  • Open Excel, Word or PDF files: only .txt, .csv and .md can be dropped in. Copying a column or a block of text and pasting it into the box works fine. To turn a whole workbook into CSV, use the spreadsheet converter; to get plain text out of a PDF, use the PDF to TXT converter.
  • Change capitalisation: case-insensitive only affects matching; the case converter makes text upper, lower or title case.
  • Count words or characters: Count occurrences counts repeated lines, so use the word counter.
  • Not covered anywhere yet: other join delimiters, splitting a comma list into lines, repeated words inside a line, and a separate list of the removed duplicates.

7. Why Cortexis Is the Best Free Duplicate Line Remover

Plenty of pages offer a box and a button. Here is what this one does differently.

Genuinely free, no account

No sign-up, no email and no daily limit. The tool at the top of this page is the whole product.

Clear matching rules

Case, surrounding spaces and first-or-last copy are three visible switches, so you always know why a line stayed or went.

Fourteen actions on one page

Dedupe, five sorts, shuffle, reverse, numbering, prefix and suffix, trim, count and join, without hopping between sites.

Your lists stay private

Customer emails and internal logs are never stored on our servers, and nothing is retained once you close the page.

Nothing is used for training

Your text is never used to train any model. A mailing list stays yours by policy.

Honest about limits

Where another tool does the job better, such as comparing two lists, this page says so and links straight to it.

It sits among a wider set of free text and file tools built on the same terms.

8. Frequently Asked Questions (FAQ)

How do I remove duplicate lines from a list for free?

Paste the list into the tool at the top of this page, or drop a .txt, .csv or .md file on it, and press Remove duplicates. Copy the result or download it as lines.txt; there is no account and no daily cap.

Does removing duplicates change the order of my list?

No. Each surviving line stays in the position of the copy that was kept, the first one by default or the last one if you untick Keep first occurrence. To sort as well, copy the result back into the box and press a sort button.

Why does sorting put 10 before 2?

Alphabetical sorting compares text one character at a time, and the character 1 comes before 2. Use Natural sort to read numbers inside lines as whole numbers, or Numeric sort when each line begins with a number.

Is the duplicate check case-sensitive?

Not by default. Case-insensitive is ticked when the page opens, so Apple and apple count as one line. Untick it when capitals matter.

How do I see how many times each line appears?

Press Count occurrences. Every distinct line is listed once with its count, most frequent first, much like sort | uniq -c.

Can I compare two lists and find what is missing?

Not with this tool; it works on one list at a time. Paste both lists into the diff checker to see which lines appear in one but not the other.

Can I remove duplicates based on one column of a CSV?

No. Each row is compared as a whole line, so it works well for a one-column CSV but not for matching on a single field. For column work, use the CSV to JSON converter or the spreadsheet converter.

Is it safe to paste a customer email list here?

Your text is never stored on our servers, nothing is retained after you close the page, and it is never used for training. The cleaned list you copy or download is yours alone.

List clean and ready for the next step? Turn it into structured data with the CSV to JSON converter, tidy the result with the JSON formatter, or encode a list of links safely with the URL encoder. And if you would like to write list-cleaning scripts of your own, our free Python development course covers working with text and files from the ground up.