Collapse repeated lines
Merge consecutive identical lines into one, similar to the Unix uniq command.
Collapse repeated lines
Collapse Repeated Lines removes consecutive duplicate lines from your text, keeping only the first (or last, or only once) of any group of identical adjacent lines. It works like the Unix uniq command: "a, a, b" becomes "a, b". Unlike Remove Duplicate Lines, which eliminates all duplicates from the entire text, this tool only affects lines that appear consecutively — so "a, b, a" stays unchanged because the duplicate "a"s are not adjacent.
This is useful when cleaning up logs with repeated entries, deduplicating output from batch jobs that print status messages multiple times, or tightening up data exports where records appear in sequential groups. You can choose to ignore case, treating "Apple", "apple", and "APPLE" as the same line. You can also trim leading and trailing whitespace before comparing, so " hello " and "hello" collapse together.
Everything runs in your browser. Your text is never uploaded anywhere, so it is safe for processing logs containing private information, database dumps, or any sensitive data. The live tally under the output shows how many lines collapsed and how many characters the result has. Copy it, download it as a .txt file, or send it to another tool when you are done.