Text Deduplicator
Remove duplicate lines, words or comma-separated items.
- Runs locally in your browser
- No upload required
Try it
Supported formats
Privacy
Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.
Kept 3 unique item(s) and removed 1 duplicate(s).
How it works
- Split the input into words.
- Compared items case-sensitively.
- Kept the first occurrence of each distinct item.
- Rejoined the surviving items in their original order.
- Word scope rejoins with single spaces, so original spacing is not preserved.
- The result is idempotent: a second run finds no duplicates.
Methodology
- Split the input according to the chosen scope.
- Build a comparison key, folding case when the comparison is case-insensitive.
- Keep the first or last occurrence of each key.
- Rejoin the survivors in their original order with the scope's separator.
Usage
- Paste the text to de-duplicate.
- Choose the scope (lines, words or commas) and keep rule.
- Run the tool and copy the unique result.
Examples
These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.
Unique words
{
"text": "alpha beta alpha gamma",
"scope": "words",
"keep": "first",
"caseSensitive": true
}Unique comma items
{
"text": "a, b, a, c",
"scope": "commas",
"keep": "first",
"caseSensitive": true
}Case-insensitive lines
{
"text": "Alpha\nalpha\nbeta",
"scope": "lines",
"keep": "first",
"caseSensitive": false
}Limitations
Choosing a de-duplication scope
Deduplicating words is useful for keyword extraction; deduplicating comma items suits tag lists and CSV cells. Choosing the scope avoids treating a whole line as one item when you only want repeated tokens removed.
Frequently asked questions
- How is this different from the Duplicate Line Remover?
- The Duplicate Line Remover works on lines only and adds trim comparison; this tool lets you choose lines, words or comma-separated items.
- What does the last-occurrence rule preserve?
- The surviving item is the last identical one, while the output keeps the order of those surviving item positions.
Sources
- ECMA-262: ECMAScript Language Specification — Map — Ecma International
- MDN Web Docs — Map — Mozilla
Send feedback
Tell us if this tool helped, report a problem, or suggest a tool. Only the message you type is sent — never the input you used in the tool.
Was this tool useful?
Prefer to write to us directly? See the contact page.