Remove duplicate lines
Strip repeated lines from a list, keeping the first occurrence of each.
How it works
Paste a list and get it back with repeats removed. The first occurrence of each line is kept in its original position, so the order you had is preserved rather than sorted away.
Two options change what counts as a duplicate. Ignoring case treats "Apple" and "apple" as the same line. Trimming whitespace first means a line with a trailing space matches one without — which is the usual reason two lines that look identical are not, and the single most common source of confusion with this kind of tool.
Nothing is uploaded. The whole operation happens in your browser, so it is safe to paste a list you would not send to a server.
This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.
Common questions
- Does this keep the original order?
- Yes. The first occurrence of each line stays where it was; only later repeats are removed.
- Why are two identical-looking lines not being merged?
- Almost always trailing whitespace or a different case. Turn on trim and ignore case and they will match.
Related pages
- Word and character counter Words, characters, sentences, paragraphs and reading time, counted as you type.
- Typing speed test Measure words per minute and accuracy on a one, two or five minute test.
- Sort lines alphabetically Sort a list of lines A–Z, Z–A, by length, or numerically.
- JSON formatter and validator Pretty-print, minify and validate JSON, with the exact position of any error.
- Text compare Compare two blocks of text and see which lines were added, removed or changed.
- Regex tester Test a regular expression against sample text, with matches and capture groups shown.
- Case converter Convert text between upper, lower, title, sentence, camel, snake, kebab and other cases.
- Remove empty lines Delete blank lines from a block of text, optionally collapsing runs to one.
- Find and replace Replace every occurrence of a string in pasted text, with optional regex.
- Readability checker Flesch Reading Ease and grade level, with sentence length and passive voice flagged.