Duplicate Word Remover
Remove a word that immediately repeats itself, so 'the the' becomes 'the', case-insensitively.
What this page does
The page removes a word that repeats itself immediately, keeping the first spelling and dropping the repeat with the whitespace before it.
How to use it
Paste or type the text and press Run. The result appears beside the form. With "the the cat sat on on the mat and and slept", the page gives:
the cat sat on the mat and slept
The rule it applies
Words are the whitespace-separated tokens, compared case-insensitively with surrounding punctuation ignored. A token equal to the word before it is dropped together with the whitespace that preceded it; a punctuation-only token resets the comparison.
Every word that is not an immediate repeat is copied through with its original spelling and spacing. Every character is read in your browser: nothing is uploaded and nothing is stored.
The page removes a word that repeats itself immediately, keeping the first spelling and dropping the repeat with the whitespace before it.
The rule this page applies: Words are the whitespace-separated tokens, compared case-insensitively with surrounding punctuation ignored. A token equal to the word before it is dropped together with the whitespace that preceded it; a punctuation-only token resets the comparison.
Worked example: "the the cat sat on on the mat and and slept" gives the output recorded in the example below, character for character.
How to use the Duplicate Word Remover
Paste or type the text into the box and press Run. The result appears beside the form, and pressing Run again re-reads whatever is in the box.
This page has nothing to configure: it reads the text and applies the rule below. the the cat sat on on the mat and and slept
The rule this page applies
Words are the whitespace-separated tokens, compared case-insensitively with surrounding punctuation ignored. A token equal to the word before it is dropped together with the whitespace that preceded it; a punctuation-only token resets the comparison.
Every word that is not an immediate repeat is copied through with its original spelling and spacing.
What to Expect
Best for
- Fixing a doubled word while typing
- Cleaning a transcript
Not ideal for
- Intentional repetition such as "very very"
- Repeats separated by punctuation
What this tool keeps
- The text exactly as you pasted it
- The same answer on every run
- Nothing sent, stored or logged
What may need cleanup
- A marker such as [email] or [url] that you want spelled differently
- Spacing carried over from the text you pasted
Common errors
- An all-whitespace input is refused, because there is no word to compare.
- An empty box, which the page refuses rather than printing a blank result
Example use cases
- Proofreading a draft
- Cleaning machine-transcribed notes
Sample input
the the cat sat on on the mat and and slept
Sample output
the cat sat on the mat and slept
Who this is for
- writers
- editors
Frequently asked questions
What rule does this page apply?
Words are the whitespace-separated tokens, compared case-insensitively with surrounding punctuation ignored. A token equal to the word before it is dropped together with the whitespace that preceded it; a punctuation-only token resets the comparison.
What input does it refuse?
An all-whitespace input is refused, because there is no word to compare.
What is left unchanged?
Every word that is not an immediate repeat is copied through with its original spelling and spacing.
Is anything uploaded?
No. The text is read by JavaScript in this page and nothing is posted, stored or logged.
Build custom tools for your store
Join the SDK program to create useful ecommerce utilities for your store.