Sorts a list one item per line, alphabetically or in natural order, and removes duplicates and blank lines. “pear, apple, pear” sorted without duplicates is “apple, pear”. Your list stays in your browser.

Paste or start typing to replace the example.

Order
Lines in
8
Lines out
6
Duplicates removed
1
Blank lines removed
1

More in Text and writing

How the list is sorted

Each line is one item. A to Z and Z to A sort with the rules of the page language, so accented letters sit with their base letter instead of after Z. Natural numbers compares runs of digits by value, so "item 2" comes before "item 10". Shortest first orders by length, Reverse order turns the list upside down and Keep order only cleans it up.

Remove duplicates keeps the first copy of each line; with Ignore case "Apple" and "apple" count as the same line. Trim spaces removes spaces at both ends of a line and Remove blank lines drops empty ones. The numbers under the result say how many lines went in and out.

Diagram of a messy list with duplicate, blank and padded lines turning into a clean, sorted list of unique lines
Sorting puts the lines in order, removes duplicate lines, drops blank lines and trims extra spaces.

Example

The list “item 10, Item 2, item 1, item 2, item 3” with one blank line, sorted A to Z with the default options, becomes “item 1, Item 2, item 2, item 3, item 10”: 6 lines in, 5 out, the blank line removed; "Item 2" and "item 2" both stay because they differ in case. With Ignore case on, "Item 2" and "item 2" are one line: “item 1, Item 2, item 3, item 10”. Without natural numbers the order is character by character: “item 1, item 10, Item 2, item 2, item 3”.

Advertisement
Two columns comparing plain character order (item1, item10, item2…) with natural order (item1, item2, item3, item10, item20)
Natural order compares the numbers inside the text by their value, so item2 comes before item10.

FAQ

Is my list uploaded? No. Sorting runs in your browser and the list is never sent to a server or put in the page address.

Which copy of a duplicate is kept? The first one in your list.

Can I sort a CSV by a column? This tool sorts whole lines. To sort the rows of a table by one column, use the table column sort tool.

Last updated:

Most popular in Digital Life

View all Digital Life calculators