Sort Lines

Sort text lines alphabetically, by length, numerically, or randomly

Input (7 lines)

Sorted (7 lines)

1apple
2Banana
3cherry
4Date
5elderberry
6Fig
7grape

About the Line Sorter

This tool sorts lines of text alphabetically, numerically, by length or randomly, ascending or descending. Numeric sorting compares values rather than characters, so 10 comes after 9 instead of landing between 1 and 2 as alphabetical sorting would put it.

Sort lines to make a list usable: alphabetising names for a directory, ordering a keyword list, arranging imports, or shuffling entries to pick a random winner.

Numeric mode matters more than it sounds. Alphabetical sorting compares character by character, so 10 lands between 1 and 2 — technically correct for text, useless for numbers. Numeric sorting reads each line as a value and orders it properly.

Sorting by length is handy for spotting outliers, such as the one truncated entry in an otherwise consistent export. Duplicate removal and empty-line dropping run in the same pass, and everything happens in your browser.

How to use the Line Sorter

  1. Paste your lines. Enter the list you want sorted.
  2. Pick a sort mode. Choose alphabetical, numeric, by length or random.
  3. Set the direction. Sort ascending or descending.
  4. Copy the result. Optionally remove duplicates and empty lines, then copy.

Line Sorter features

  • Alphabetical sorting
  • Numerical sorting
  • Ascending/descending
  • Case sensitivity
  • Remove duplicates
  • Copy results

Frequently asked questions

How do I sort lines alphabetically?

Paste your text lines and choose alphabetical or numerical sorting with ascending/descending order.

Can I sort numerically?

Yes! Detects numbers and sorts them numerically instead of alphabetically.

What about case sensitivity?

Choose case-sensitive or case-insensitive sorting for different results.