Remove Duplicate Words
Paste your text to remove repeated words. By default only words doubled in a row ("the the") are fixed; switch to Every repeat of a word to keep just the first use of each word in the whole text.
0 words 0 characters 0 lines
Continue with this text: Remove duplicate linesWord frequencyRemove extra spaces
Your text stays in your browser: nothing is uploaded or stored on a server.
How to use it
- Paste or type your text in the box, or use Open file for a plain-text file. Example loads a short sample that shows both kinds of repeat.
- Under Remove, choose Repeated words in a row (the the) to fix typing mistakes, or Every repeat of a word to keep only the first use of each word.
- Tick Case-sensitive if Apple and apple should count as different words.
- Read the result and the note above it, for example 2 words removed. Then Copy, Download .txt, or Use as input to run another cleaning step on the result.
The two modes
| Repeated words in a row | Every repeat of a word | |
|---|---|---|
| What it removes | A word typed again straight after itself | Every use of a word after the first, anywhere in the text |
| Typical use | Proofreading prose | Keyword lists, tags, word lists |
| Punctuation | Kept | Moved to the previous word if it has none, otherwise dropped |
| Spacing | Unchanged | Double spaces and tabs become one space; lines are trimmed |
| Line breaks | Kept; repeats must be on the same line | Kept |
The sample shows the difference. With the default mode:
Before:
Paris in the the spring is is lovely.
red blue red green blue
After (2 words removed):
Paris in the spring is lovely.
red blue red green blue
The second line is untouched because no word follows itself there. With Every repeat of a word the first line is cleaned the same way and the second becomes red blue green (4 words removed in total).
How words are compared
In a row. A word here is a run of letters, digits and apostrophes, so don’t, it’s, 3 and café each count as one word. The repeat must be on the same line, separated only by spaces or tabs. Anything else between the two words breaks the match: a line break, a comma, a period or a dash. A word joined to another by a hyphen is not compared on its own, so well-known known fact and go go-go go stay unchanged.
| Before | After | Why |
|---|---|---|
I said that that is fine |
I said that is fine |
The second that follows the first directly. |
very very very good |
very good |
Any number of repeats collapse to one (2 removed). |
don't don't stop |
don't stop |
Apostrophes are part of the word. |
the, the cat |
the, the cat |
A comma sits between them. |
Hello. Hello! hello? |
no change | Each word is followed by punctuation. |
New York New York |
no change | Only single words are compared, not phrases. |
Grammatical doubles such as that that or had had are removed too, because the tool cannot tell a typo from a correct sentence. Read the result when you clean prose.
Every repeat. Here the text is split at spaces, tabs and line breaks, and each piece is compared without the punctuation at its start and end. Hello., Hello! and hello? are the same word, and so are (note) and note. Hyphenated words, numbers with commas and email addresses are compared as whole pieces, so well-known is not the same as known.
| Before | After |
|---|---|
red, blue, red, green |
red, blue, green |
buy shoes, cheap shoes, shoes online |
buy shoes, cheap, online |
1,000 1,000 people |
1,000 people |
The cat. the dog. THE end |
The cat. dog. end |
Edge cases worth knowing
- Case. Without Case-sensitive, Hello hello HELLO becomes Hello: the first spelling stays. With it ticked, nothing is removed.
- Accents. café and cafe are different words, and so are Straße and STRASSE. To treat accented and plain letters as the same, run remove accents first.
- Line breaks in the default mode. Only repeats on the same line count, so line breaks and blank lines are never removed.
theat the end of one line followed bythe endon the next is left as it is, andx x, a blank line, thenx ybecomesx, a blank line,x y. To catch a repeat split across lines, join the lines first with remove line breaks. - Punctuation in the every-repeat mode. Commas and periods after a removed word move to the word before it if that word ends in a letter or digit (
buy shoes, cheap shoes,givesbuy shoes, cheap,). A removed word that starts with a bracket or quote goes together with its closing half, and only sentence punctuation (. , ; : ! ? …) after it is kept:note (note)givesnote,tags: red (red) bluegivestags: red blueandword (word).givesword.. - Lines in the every-repeat mode. The comparison covers the whole text, not each line. When every word on a line is removed, an empty line stays in its place:
one,two,oneon three lines givesone,twoand a blank third line. Remove empty lines deletes it if you don’t need the rows to line up. - Emoji and symbols. A piece with no letter or digit, such as 😀 or a lone dash, is never removed.
- Long text. Everything runs in your browser. A test text of 200,000 words was processed in well under a second.
When people need it
- Proofreading. Doubled words such as the the or is is are easy to miss on screen, especially across a line break. The default mode only finds repeats on the same line, so for hard-wrapped text remove the line breaks first. Run the default mode, then compare the word count with the word counter.
- Keyword and tag lists. SEO and social media lists built from several sources often repeat terms. Every repeat of a word leaves one copy of each, in the original order.
- Text pasted from PDFs or transcripts. Copy errors and speech-to-text output often repeat a word. Run the default mode after removing line breaks.
- Vocabulary lists. To find out which words repeat before removing them, the word frequency counter lists each word with its count.
Duplicate words vs duplicate lines
This tool compares single words. If your list has one item per line and the items have several words, such as blue shoes and red shoes, Every repeat of a word would remove the second shoes and break the list. Use remove duplicate lines instead: it compares whole lines, so red shoes stays and only exact repeated lines go.
Questions
Does it remove every repeated word or only "the the"?
Both are possible. The default, Repeated words in a row (the the), only removes a word that is typed twice or more in a row. Every repeat of a word removes each later use of a word anywhere in the text and keeps the first one.
Is "The" the same word as "the"?
Yes, by default case is ignored and the first spelling is kept, so The the cat becomes The cat. Tick Case-sensitive to treat The and the as different words.
Can I remove duplicate keywords from a comma-separated list?
Yes, with Every repeat of a word. red, blue, red, green becomes red, blue, green. The tool works word by word, so in a list of phrases a repeated word inside a different phrase is removed too; for phrase lists, put one phrase per line and use remove duplicate lines.
How do I remove duplicate words in Excel cells?
Copy the cells, paste them here, choose a mode and paste the result back. Each cell becomes one line, and a line whose words were all removed stays as an empty line, so the rows still line up. Every repeat of a word compares words across all pasted cells, not within each cell, so for per-cell cleaning paste one cell at a time.
Does the tool keep my punctuation?
In the default mode, yes, because only the repeated word and the space before it go. In Every repeat of a word, punctuation after a removed word moves to the word before it when that word has none, so word word, becomes word, and the the. The cat becomes the. cat. A removed word in brackets or quotes takes its closing bracket or quote with it, so note (note) becomes note and word (word). becomes word.
Is my text uploaded?
No. The words are compared in your browser and nothing is sent to a server. The note above the result shows how many words were removed.