Remove Duplicate Lines

Clean up any list: remove duplicate and empty lines, trim spaces, sort A–Z or by length, and more.

Options

Duplicates

Keeps the first copy of each line and removes the rest.

Prefix and suffix

Spaces count: type “- ” to remove a dash and the space after it.

Applied in this order: trim, remove prefix and suffix, remove empty lines, duplicates, sort, add prefix and suffix.

Result
Your cleaned list appears here.
Lines in
0
Lines out
0
Duplicates removed
0
Empty lines removed
0

Everything runs in your browser: nothing is sent to Tooly's server. Lists up to 200 KB are saved in your browser so they are still here next time.

Embed this tool on your site

Free and without an account: copy the code and paste it into your website, blog or docs.

About Remove Duplicate Lines

Paste a list, or drop a .txt or .csv file, and get it back clean: without duplicate lines (matching case or not), without empty lines and with spaces trimmed, sorted alphabetically, naturally, by length or in reverse, or shuffled, and with a prefix or suffix added to or removed from every line. Counters show how many lines were removed, and the result can be copied or downloaded.

How to use Remove Duplicate Lines

  1. Paste or open your list

    One item per line. Paste it, open a .txt or .csv file, or drop the file on the box. The result updates as you type.

  2. Choose the options

    Trim spaces and Remove empty lines are on by default. Under Duplicates, choose Remove duplicates to keep the first copy of each line or Only unique lines to drop every repeated line; Ignore case treats Apple and apple as the same. Then pick a sort order and, if you need them, a prefix or suffix to add or remove.

  3. Copy or download the result

    Check the counters (lines in and out, duplicates and empty lines removed), open the list of removed duplicates to see what went, and copy the result or download it as a .txt file.

When to use it

Email lists and contacts

Remove repeated addresses from a mailing list merged from several sources, ignoring case so [email protected] and [email protected] count as one.

Keywords, tags and SEO lists

Dedupe and sort keyword research or tag lists before importing them into another tool.

Data and code

Clean a column copied from a spreadsheet, find the values that appear more than once, or wrap every line in quotes with a comma at the end to paste it into SQL or JavaScript.

Frequently asked questions

Which copy of a duplicate is kept?

The first one, in its original position and with its original case. With Only unique lines no copy is kept: every line that appears more than once is removed, which is how you find the values that are not repeated.

Does it compare lines exactly?

Yes, character by character, after the steps that come before it: trimming, removing the prefix or suffix and removing empty lines. With Trim spaces on, "apple " and "apple" are the same line; with it off, they are different. Ignore case makes Apple and apple equal, but accents still count: café and cafe are different lines.

What is natural sort?

An alphabetical sort that reads numbers by their value, so item 2 comes before item 10. A plain A–Z sort compares character by character and puts item 10 first. Both follow the page's language, so accented letters sit with their base letter (Árbol next to arbol, not after Z).

In what order are the options applied?

Always the same: trim spaces, remove the prefix and suffix, remove empty lines, remove duplicates, sort, and finally add the prefix and suffix. Because the prefix is removed before looking for duplicates, "- apple" and "apple" count as the same line once the dash is gone.

How long can the list be, and is it uploaded?

Lists of 100,000 lines are processed in your browser in about a second or less, and files up to 50 MB can be opened. To keep the page fast, the result box shows the first 5,000 lines; Copy and Download always include all of them. Nothing is sent to Tooly's server, and lists up to 200 KB are saved in your browser for next time.