Text Tools

Sort Lines Alphabetically Online

Paste any list and put it in order: A–Z, Z–A, numeric, natural (so "item 2" comes before "item 10"), by length or random. Clean out duplicates and blank lines at the same time.

AdvertisementAd slot: leaderboard-top

Embed this tool

Put this free Sort Lines on your own website — copy the code below and paste it into your page's HTML.

AdvertisementAd slot: in-content

How to sort lines

  1. Paste your list into the left box, one item per line.
  2. Choose how to sort. The result updates instantly on the right.
  3. Tick the cleanup options you want, then copy the result.

Alphabetical vs natural sorting

Plain alphabetical sorting compares text character by character, so "item 10" comes before "item 2" because the character 1 is less than 2. Natural sorting reads the numbers inside the text as numbers, giving the order people expect: item 1, item 2, item 10. Use it for file names, version numbers, addresses and chapter lists.

Sorting ignores capitalization by default, so "apple" and "Apple" sit together. Tick case-sensitive to put all capitalized lines first, which matches how many programming tools sort. Alphabetical sorting also follows your language's rules for accented letters, so "école" sorts next to "ecole" rather than after "z".

Common uses: alphabetizing a bibliography, guest list or glossary, ordering a list of numbers, randomizing quiz questions or presentation order, and cleaning up a list pasted from a spreadsheet. Everything runs in your browser.

Need a different tool? Suggest it here — we read every message.

Frequently asked questions

How do I alphabetize a list?

Paste it in, choose "Alphabetical (A–Z)" and copy the result. Tick "Remove duplicates" to clean it up at the same time.

What is natural sort?

Sorting that treats numbers inside text as numbers, so "file 2" comes before "file 10".

Is the random shuffle fair?

Yes. It uses an unbiased Fisher–Yates shuffle with your browser's secure random numbers.

Is there a size limit?

No fixed limit. Lists with tens of thousands of lines sort instantly.

Related tools & templates

AdvertisementAd slot: footer-leaderboard