Spincrus

Tools › Remove Duplicate Lines

Remove Duplicate Lines

Free online tool to remove duplicate lines from a list. Keep the first occurrence, ignore case or spaces, drop empty lines, optionally sort A–Z.

Runs in your browser. Nothing is uploaded.

Use it from code

The same function is available as an API endpoint. Free tier: 100 calls per day without a key. Pro lifts the limit.

curl -X POST https://spincrus.uz/api/v1/tools/remove-duplicate-lines \
  -H "content-type: application/json" \
  -H "x-api-key: YOUR_KEY" \
  -d '{"text":"apple\nbanana\nApple\napple\n\ncherry\nbanana","caseSensitive":false,"removeEmpty":true}'

FAQ

Which copy of a duplicate line is kept?

The first one. Lines keep their original order, and every later line that matches an earlier one is dropped. Turn on sorting if you would rather have the result in alphabetical order.

How do I treat "Apple" and "apple" as the same line?

Turn off "Case sensitive". Lines are then compared in lower case, and the first spelling you wrote is the one that stays in the output.

Why are lines that look identical not removed?

They probably differ by invisible trailing spaces or tabs. Turn on "Trim spaces around lines" so leading and trailing whitespace is ignored when comparing.

Related tools