๐Ÿงน

Remove Duplicate Lines

Remove duplicate lines from a list or text, with options to ignore case and trim spaces.

Built and maintained by Abdur Rehman ยท Free, no sign-up

Loading Remove Duplicate Linesโ€ฆ
๐Ÿ”’PrivateRuns in your browser โ€” nothing is uploaded.
โšกFastInstant results, no waiting in queues.
๐Ÿ’ธFreeNo sign-up, no watermark, no limits.
๐Ÿ“ฑAnywhereWorks on phone, tablet and desktop.
</> Embed this tool on your website โ€” free

Paste this code into any web page or blog post (WordPress: use a โ€œCustom HTMLโ€ block). It's free for personal, school and business sites โ€” just keep the credit link.

How to use the Remove Duplicate Lines

  1. Paste your list
  2. Choose the options
  3. Copy the list without duplicates

Clean up a list in one step

Paste a list and duplicate lines are removed instantly, keeping the first copy of each line in its original order. Options: Ignore case (so โ€œAppleโ€ and โ€œappleโ€ count as the same), Trim spaces, Remove empty lines and Sort A โ†’ Z. You see how many lines were removed. Useful for lists of emails, keywords, URLs or names.

From a text file

Open the file, copy everything, paste it here, then copy the result back. Nothing is uploaded.

In other programs

  • Excel โ€” Data โ†’ Remove Duplicates.
  • Notepad++ โ€” Edit โ†’ Line Operations โ†’ Remove Duplicate Lines.
  • VS Code โ€” run โ€œDelete Duplicate Linesโ€ from the Command Palette (Ctrl + Shift + P).
  • Sublime Text โ€” Edit โ†’ Permute Lines โ†’ Unique.
  • Vim โ€” :sort u (this also sorts the lines).

On Linux

sort -u file.txt removes duplicates but changes the order. To keep the original order, use awk '!seen[$0]++' file.txt โ€” the same thing this page does.

Lines in drawings

Duplicate lines in CAD and design files are a different problem: in AutoCAD the OVERKILL command deletes overlapping geometry, and in Illustrator you can select overlapping paths and merge them with Pathfinder.

โœ๏ธ Keep exploring Text Tools

See all Text Tools