Sort & Remove Duplicate Lines

Paste a list of lines and sort, deduplicate, or remove blank lines.

What it's for

Useful for organizing lists of emails, URLs, filenames, tags, or any line-by-line list — sorting alphabetically, removing repeated entries (keeping the first occurrence of each), or cleaning up blank lines.

How it works

Sorting compares each line's text; deduplication preserves the original order of the remaining lines (always keeping the first occurrence of each repeated value).

Usage examples

With the lines banana, Apple, banana and cherry, removing duplicates leaves three lines and keeps the first banana. Sorting afterwards puts Apple before banana, since the comparison follows the browser's locale-aware rules rather than raw character codes.

Traps with numbers and spaces

Alphabetical sorting treats numbers as text: 10 comes before 2 because the character 1 precedes 2. If you need numeric order, pad with leading zeros (02, 10). Leading spaces also change the order and stop two lines from being seen as equal, so strip them before deduplicating lists pasted from spreadsheets.

Frequently asked questions

Is sorting case-sensitive?

Comparison uses the browser's standard string ordering, which usually treats uppercase and lowercase slightly differently — for most everyday lists, the result is as expected.

Are two lines with trailing extra spaces considered duplicates?

No — deduplication compares the exact line text, including spaces. Use "Remove blank lines" separately to clean up blank ones.

How do I sort in reverse or flip the list?

Use the reverse option if available, or sort ascending and then reverse the list. To sort numbers properly, align them with leading zeros, since the sorting is textual.

Does removing duplicates ignore upper and lower case?

No. Apple and apple count as different lines because the comparison is exact. Convert everything to one case first if you want them merged, keeping in mind the original capitalization is lost.

Can I use it to clean up a mailing list?

Yes. Paste one address per line, remove duplicates, and sort. Trim stray spaces first, since two otherwise identical addresses with a trailing space are kept as separate lines.