UTILS.
Private by default
≠w

Remove Duplicate Words

Remove repeated words from text, keeping the first occurrence.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
output

About this tool

Strip repeated words from text and keep only the first occurrence of each, all in your browser.

Text is split on any run of whitespace, so line breaks and repeated spaces are separators, and the first occurrence of each word is kept. Punctuation stays attached: "cat" and "cat," are different words. Kept words are joined with single spaces, so the output is one line, and a note shows how many words were removed out of the total.

Case-insensitive (on by default) treats "Apple" and "apple" as the same word and keeps the first. Turning Keep order off sorts the survivors by character code, so with case-sensitive matching capitals come first.

Frequently asked questions

How are words split?
Text is split on any whitespace, then the first occurrence of each word is kept and later repeats are dropped.
Does it ignore letter case?
With case-insensitive on, Apple and apple count as the same word; turn it off to treat different casing as distinct.
Does it keep my line breaks?
No. The result is a single line of words separated by single spaces.
Why was a word with a comma not removed?
Punctuation is part of the word, so "cat," and "cat" differ. Remove the punctuation first.

More tools