How to Sort Text Lines Alphabetically
August 23, 2026 4 min read

How to Sort Text Lines Alphabetically

Learn how to sort a list of text lines alphabetically, in reverse, or randomly — and remove duplicates at the same time.

Learning how to sort text alphabetically saves you from reordering a long list by hand. Whether it is names, keywords, tasks or data, a sorting tool arranges every line in seconds and can clean up duplicates while it works.

Ways to sort a list

  • A to Z — standard alphabetical order.
  • Z to A — reverse alphabetical order.
  • Random — shuffle the lines, great for draws.

Sorting options that matter

OptionWhy it helps
Ignore caseTreats "Apple" and "apple" the same.
Numeric awarePuts 2 before 10 correctly.
Remove duplicatesKeeps only unique lines.

How to sort in steps

Paste your list with one item per line, choose an order, and copy the result. It is that simple.

Everything runs in your browser, so even long or private lists never leave your device.

Sort your list now

Our Sort Text tool orders lines A→Z, Z→A or randomly and can remove duplicates in one step, and if you only want to strip repeats the Duplicate Line Remover focuses on that. For how natural alphabetical ordering works under the hood, MDN documents localeCompare. Paste, sort, copy — done.

Tools mentioned in this article

More articles