TEXT TOOL

Sort Lines Alphabetically

Paste a list and sort it alphabetically, numerically, or in reverse — one line per item.

About this tool

Sorts a block of text one line at a time — alphabetically by default, or numerically when a line's leading value is a number. Useful for tidying lists that arrived in no particular order: exported data, a list pasted from a spreadsheet, or notes collected over time.

How to use the Line Sorter

  1. Paste your list, one item per line.
  2. Choose ascending or descending, and enable numeric sort if your lines are mostly numbers.
  3. Click "Sort lines" and copy the result.

Common use cases

Worked example

A plain alphabetical sort compares text character by character, so "10" sorts before "9" because "1" comes before "9" as a character — the same reason "Item 10" would sort before "Item 2" in a text sort. Enabling Numeric sort fixes this for lines that are purely numbers (or start with one): each line is compared by its actual numeric value first, so 2, 9, and 10 sort in that order rather than 10, 2, 9. Lines that aren't numbers fall back to a normal text comparison and are sorted after any numeric lines.

Things to watch out for

Case-insensitive sorting affects comparison only — the original capitalization of each line is kept in the output. Numeric sort looks at what a line starts with using standard decimal parsing, so a line like "42 items" is treated as the number 42, but a line like "Room 42" is not (since it doesn't start with a digit) and is sorted as text instead. If you need "Room 42" and "Room 9" to sort numerically by their trailing number, this tool won't do that — it only reads a leading numeric value.

Frequently asked questions

Does numeric sort work on numbers anywhere in the line, or just at the start?

Only at the start. A line is treated as numeric if it begins with a valid number (like "42 items"); lines that don't start with a number, such as "Room 42", are sorted as plain text instead.

Will sorting change the capitalization of my lines?

No. "Case-insensitive" only affects how lines are compared during sorting — the text of each line in the output is exactly what you pasted in.

What happens to blank lines?

With "Skip blank lines" enabled (the default), empty lines are removed before sorting. Uncheck it if you want blank lines kept and sorted in along with everything else, alphabetically that means they'll sort first.