REMOVE DUPLICATE LINES
Paste text and strip out repeated lines, keeping the order intact. Nothing leaves your browser.
In short
Paste text and remove duplicate lines instantly, with options for case sensitivity, trimming whitespace, and keeping the first or last occurrence. Runs entirely in your browser.
Before: 7After: 5Removed: 2
How to remove duplicate lines
- 1
Paste or type your text into the input box.
- 2
Choose case sensitivity, whitespace trimming, and whether to keep the first or last occurrence of each line.
- 3
Copy the deduplicated result from the output box — it updates live as you type or change options.
Questions
- How are duplicate lines detected?
- The tool splits your text into lines and compares them for equality. With case sensitivity off, "Apple" and "apple" are treated as the same line. With trim whitespace on, leading and trailing spaces are ignored before comparing.
- What's the difference between keep first and keep last?
- Keep first keeps the earliest occurrence of each unique line and drops later repeats. Keep last does the opposite — it drops earlier repeats and keeps the final occurrence, which is useful when a later line is the most up to date version.
- Does this preserve line order?
- Yes. The output keeps lines in their original relative order — it only removes the duplicate occurrences, it doesn't sort or reorder anything.
- Is my text uploaded anywhere?
- No. Everything runs locally in your browser with JavaScript — your text is never sent to a server.
Related tools
- Sort Text LinesSort lines alphabetically, numerically, or by length, with dedup and trim options.
- Add Prefix to LinesAdd a prefix, suffix, or running number to every line of text.
- Remove Extra SpacesCollapse repeated spaces and tabs into one, with options to trim lines and drop empty ones.
- Remove Line BreaksJoin multi-line text into one block, replacing line breaks with a space or nothing.
- Text CleanerTrim lines, collapse spaces, strip HTML tags, punctuation, or numbers in one pass.
- Text Diff CheckerCompare two blocks of text line by line and see what was added, removed, or unchanged.
- Email ExtractorPull every email address out of pasted text, deduplicated and one per line.
- URL ExtractorPull every URL out of pasted text, deduplicated and one per line.
Updated