Text Line Sorter

Sort lines of text alphabetically or numerically, with natural sort order and optional duplicate removal. Useful for alphabetizing a list of names, ordering a version history, or sorting a spreadsheet-exported price list, free and instant in your browser.

Sort mode
Direction
Output

Usage examples

Sorting file names or list items in numeric order

Use natural sort so 'file2' comes before 'file10' — the order humans actually expect instead of plain character comparison.

Alphabetizing a list of names

Quickly sort a list of names copied from a spreadsheet or notes into alphabetical order.

Removing duplicates while sorting

Turn on remove duplicate lines to get a sorted list with each unique line appearing only once.

Sorting a spreadsheet-exported price list

Paste a list like '$19.99 Widget', '$9.50 Gadget', '$100.00 Deluxe Kit' and sort alphabetically to quickly see which price strings come first — useful when you need a quick lexical check before importing into another tool.

Putting a version history in the right order

Lines like 'v1.9.0', 'v1.10.0', 'v1.2.0' look out of order under plain alphabetical sort. Switch to natural sort so 'v1.2.0' comes before 'v1.9.0' and 'v1.9.0' comes before 'v1.10.0', matching real version order.

Frequently asked questions

Is my text sent to a server?

No. All sorting happens entirely in your browser, and what you enter is never sent to a server.

What's the difference between natural and alphabetical sort?

Alphabetical sort compares characters one by one, so 'item10' comes before 'item2'. Natural sort recognizes number chunks as actual numbers, so 'item2' comes before 'item10'.

How are blank lines handled?

A blank line is treated as a line like any other and is included in the sort order — it isn't removed automatically.

Can I undo a sort and get my original order back?

Toggling the direction button reverses the current result, but the original input order before sorting isn't stored separately — you'd need to paste your original text again.

What does case sensitive actually change?

With case sensitivity on, uppercase letters sort before lowercase ones (so 'Zebra' comes before 'apple' because 'Z' has a lower character code than 'a'). With it off, lines are compared as if everything were the same case, giving the alphabetical order most people expect.

Why would I turn on trim whitespace per line?

Text pasted from spreadsheets or PDFs often has trailing spaces or tabs you can't see. Without trimming, ' Apple' and 'Apple' are treated as different strings and may end up in an unexpected order; trimming normalizes them before comparing.

Does removing duplicates keep the first or last occurrence?

The first occurrence of each unique line (in your original input order) is the one kept; later repeats of the same line are dropped before sorting.