Home › Text Tools › Remove Duplicate Lines

Remove Duplicate Lines

Paste a list and every repeated line is removed instantly. Ignore case, extra spaces or accents, keep the first or last copy, sort the result, and see exactly which lines were duplicates.

Last updated:

0 lines
0 lines

Results update live. Everything runs in your browser, so even lists of 100,000+ lines are processed instantly and never uploaded.

Advertisement
Advertisement

How to use the Remove Duplicate Lines

  1. Paste your list into the left box, one item per line (or choose commas, tabs or another separator).
  2. Choose how to match: ignore case, trim spaces, ignore extra spaces inside lines or ignore accents.
  3. Pick what to keep: the first copy, the last copy, only lines that never repeat, or only the repeated lines.
  4. Sort the result if you like, then check the counts and the Removed tab.
  5. Copy or download the unique lines, or press Use result as input to keep working on them.

What each option does

OptionExample inputTreated as
Ignore upper/lower caseApple, apple, APPLEone line
Trim spaces at line ends"apple" and " apple "one line
Ignore extra spaces inside lines"New York" and "New York"one line
Ignore accentscafé, cafeone line
Remove empty linesblank or space-only linesdeleted from the result

The line that is kept is shown exactly as you typed it (after trimming), so the matching options never change your text, only which lines count as the same.

Keep first, keep last, unique only, or duplicates only

For the list a, b, a, c, b, a:

  • Keep the first copy gives a, b, c (3 duplicates removed).
  • Keep the last copy gives c, b, a, the order in which each item last appears.
  • Remove every line that repeats gives c, the only item that appears once.
  • Show only lines that repeat gives a, b, handy for spotting double entries.

Tip: to find lines that two lists have in common, paste both lists together and choose Show only lines that repeat (make sure neither list has internal duplicates first).

Frequently asked questions

How do I remove duplicate lines from a list?

Paste the list into the input box. Duplicate lines are removed immediately and the unique lines appear on the right, in their original order. Press Copy result or Download .txt to save them.

Is the comparison case-sensitive?

By default no: Apple, APPLE and apple count as the same line and the first one you wrote is kept. Untick Ignore upper/lower case to treat them as different lines.

What is the difference between keep first and keep last?

Both leave one copy of every line. Keep the first copy keeps each line at the position where it first appears; keep the last copy keeps it where it appears last, which is useful when later entries are newer.

Can I remove both copies of a duplicated line?

Yes. Choose Remove every line that repeats. Only lines that appear exactly once are kept, which is handy for finding unique entries between two merged lists.

Can it remove duplicate words or comma-separated values?

Yes. Set Items are separated by to Commas, Semicolons, Tabs or Spaces. The result is joined with the same separator.

How many lines can it handle?

Hundreds of thousands. It uses a hash map, so even very long lists are processed in a fraction of a second, all inside your browser with nothing uploaded.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Sort Lines AlphabeticallySort a list A-Z, Z-A, numerically, naturally or by length, or shuffle it.Remove Line BreaksStrip line breaks and extra spaces, keep paragraphs if you want.Text CompareFind the differences between two texts.Word Frequency CounterFind the most used words and phrases in any text and turn them into a word cloud.Address Label MakerPaste addresses or import a CSV and get a print-ready PDF of address labels for common sheets.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.Online Word ProcessorFree browser word processor with headings, lists, tables and images. Autosaves; export DOCX or PDF.Case ConverterConvert text to UPPERCASE, lowercase, Title Case, camelCase and more.MLA Format GeneratorBuild an MLA 9 heading, title page layout and Works Cited entries.Lorem Ipsum GeneratorGenerate placeholder text as paragraphs, words or lists, with HTML.Text RepeaterRepeat any text or emoji up to 100,000 times with custom separators.Find and Replace TextFind and replace words or regex patterns in any text, with match highlighting and undo.Add Line NumbersNumber every line of your text with custom start, step, padding and separator, or remove numbers.Add Prefix and Suffix to LinesAdd text to the start and end of every line: quotes, commas, bullets or SQL lists.Comma SeparatorTurn a column of lines into a comma separated list and back, with any delimiter.Text to Handwriting ConverterTurn typed text into realistic handwriting on notebook paper and save it as PNG or PDF.Japanese Kana ConverterConvert romaji to hiragana or katakana, kana to romaji, and hiragana to katakana instantly.Pinyin Tone ConverterTurn pinyin tone numbers (ni3 hao3) into tone marks (nǐ hǎo), or tone marks back into numbers.Remove Extra SpacesClean up double spaces, tabs, blank lines, non-breaking and invisible spaces in one click.Random Word GeneratorGenerate random English words by type, length, first letter and syllables, then copy them.List RandomizerShuffle a list into random order, pick random items or split it into fair teams.Email ExtractorPull every unique email address out of text or files, sort, filter by domain and export CSV.URL ExtractorExtract every link from text or HTML, remove duplicates, filter by domain or protocol.Strip HTML TagsRemove HTML tags and get clean plain text with line breaks and decoded entities.Online NotepadPrivate notepad that autosaves notes in your browser, with find, word count and .txt download.Remove PunctuationStrip all or only selected punctuation from text, with smart options for apostrophes and numbers.Text SplitterSplit long text into chunks by characters, words, lines or a delimiter, with numbering and copy.Remove AccentsStrip accents and diacritics from text (é→e, ñ→n, ß→ss, ø→o) instantly, live as you type.Sort NumbersPull numbers out of any text and sort them ascending or descending, with sum, average and median.Thread SplitterSplit long text into numbered X, Threads, Bluesky or Mastodon posts at sentence boundaries.Duplicate Word FinderFind repeated words in your text: doubled words like "the the" and overused words, highlighted.Alternating Caps GeneratorTurn text into aLtErNaTiNg caps, random caps or alternating words, then copy it.Random Paragraph GeneratorGenerate readable random English paragraphs by topic and length for writing and design.Random Sentence GeneratorGenerate random grammatical sentences: simple, compound, complex and questions.Markdown to Plain TextStrip Markdown syntax and keep clean plain text with lists, line breaks and link URLs.SRT to TextTurn SRT or VTT subtitles into a clean transcript with paragraphs, with or without timestamps.Remove Line NumbersStrip leading numbers like 1., 1), [1] or code line numbers from every line and keep the text.Remove Stop WordsStrip common stop words (the, and, of…) from text in 7 languages to reveal the keywords.Remove Text in BracketsDelete everything inside ( ), [ ], { }, < > or custom markers, with nested bracket support.Remove URLs from TextStrip links, www addresses and bare domains from text, plus emails, @mentions or hashtags.Trim Characters from LinesRemove the first or last N characters, or text before/after a marker, on every line.Transcript CleanerRemove timestamps, speaker labels and filler words like um and uh, and fix broken line breaks.Extract Numbers from TextPull every number out of text: decimals, negatives and percentages, with sum, average and CSV.Extract Phone NumbersFind phone numbers in any text, normalize them to E.164, remove duplicates and export CSV.Paragraph to Bullet Points ConverterSplit paragraphs into bullet points by sentence or clause, with your choice of bullet style.Compare Two ListsFind items only in list A, only in list B, in both lists, or in either, with copy and sort.DOCX to Text ConverterExtract plain text from Word .docx files, in batch, with list markers, tables and .txt download.English to IPA ConverterConvert English text to IPA phonetic transcription in US or UK accent, with stress marks.Hidden Character DetectorFind and remove zero-width spaces, non-breaking spaces and other invisible Unicode characters.Letter to Number ConverterConvert letters to alphabet numbers (A=1 to Z=26) and back, with ASCII codes and letter sums.Markdown to Word ConverterConvert Markdown to a styled Word .docx file with headings, lists, tables, code and links.Plural GeneratorConvert English nouns from singular to plural and back, irregulars included, one word per line.Remove Empty LinesDelete blank and whitespace-only lines, or collapse gaps to one, with before/after line counts.Remove Text FormattingPaste rich text from Word, Google Docs or the web and get clean plain text instantly.Smart Quotes ConverterConvert curly quotes, dashes and ellipses to straight ASCII, or straight quotes to typographic ones.Text to HTML ConverterTurn plain text into clean HTML: paragraphs, line breaks, links, lists and escaped entities.Text to Word ConverterTurn text or a .txt file into a Word .docx with your font, margins and page size.WhatsApp Text FormatterFormat WhatsApp messages with bold, italic, strikethrough, monospace, lists and quotes, then copy.Word CombinerBlend two or more words into portmanteaus, compound and clipped names for brands and wordplay.Word to HTML ConverterConvert Word .docx files or pasted rich text into clean, semantic HTML with live preview.Word Wrap ToolWrap text at any column width with hard line breaks, indents and prefixes, or unwrap it again.Daily Affirmation GeneratorGet random positive affirmations by theme; save favorites, copy them or make an image card.Business Plan GeneratorFill in a guided form and get a formatted business plan with financial tables, as Word or PDF.Keyword Match Type ConverterTurn a keyword list into broad, "phrase", [exact] and negative match types for PPC ads.Discord Text FormatterFormat Discord messages with bold, spoilers, headers, quotes, lists and code blocks, with live preview.DNA Reverse ComplementGet the reverse, complement or reverse complement of DNA/RNA, FASTA and IUPAC codes supported.
See all 96 Text Cleaning & Formatting →