Sort Lines Alphabetically

Put any list in order. Sort lines alphabetically from A to Z or Z to A, in natural order so that “item 2” comes before “item 10”, by length from shortest to longest, or simply reverse the current order. Ignoring case keeps “apple” and “Apple” together.

Text

Loading tool…

At a glance

Orders
Natural A–Z, alphabetical A–Z, alphabetical Z–A, shortest first, reverse
Case
Optionally ignore upper and lower case
Ties
Equal-length lines are ordered alphabetically
Not changed
Line content; blank lines are sorted like any other line

How it works

  1. Paste the list

    One item per line.

  2. Choose the order

    Natural, A to Z, Z to A, by length or reverse.

  3. Copy the result

    The sorted list appears instantly.

Which list tool fits?

Sorting is often one step of a clean-up.

OptionBest forTrade-off
Sort Lines (this page)Putting a list in a chosen order.Keeps duplicates.
Remove Duplicate LinesRemoving repeats while keeping order.Does not sort.
Text CompareComparing two sorted lists.Sort both first.
Case ConverterMaking capitals consistent.Does not reorder.
Random PickerChoosing items at random.Not an ordering tool.

Example: numbered items

A list contains item 10, Item 2, item 1, banana and Apple.

  1. With Natural A to Z and Ignore case, the result is Apple, banana, item 1, Item 2, item 10.
  2. With plain Alphabetical A to Z, item 10 comes before Item 2, because 1 sorts before 2 character by character.

When to use Sort Lines Alphabetically

Use it for student and guest lists, file and product names with numbers, glossary terms, bibliography entries and keyword lists. Reverse order is useful when a list was exported newest-last.

Natural versus alphabetical

Alphabetical sorting compares character by character, so “10” is less than “2” because “1” comes before “2”. Natural sorting reads runs of digits as numbers, which matches how people expect numbered items to be ordered.

Language-aware comparison

The browser’s collation rules place accented letters next to their plain forms and handle case sensibly, so names such as “Émile” do not end up after “Z”.

Sorting by length

Ordering by length helps find unusually long or short entries, such as truncated names or pasted paragraphs in a list of short codes.

Preparing messy lists

Lists copied from spreadsheets, emails or PDFs often carry stray spaces, mixed capitals and repeated entries. A tidy routine is to trim and remove duplicates with Remove Duplicate Lines, sort here with Ignore case ticked, and then compare against the previous version with Text Compare to see what was added. Doing the steps in that order avoids duplicates that differ only by a space appearing next to each other after sorting.

Sorting names in Indian lists

Names may start with initials, such as “R. Sharma” and “Ravi Sharma”. Sorting compares from the first character, so initials group together before full first names. If you need surnames first, rearrange the names in a spreadsheet, then paste the result here to sort.

Large lists

Thousands of lines sort in a moment in a current browser, and the result updates as you change the order or paste new text.

Reverse versus Z to A

Reverse simply flips the list as it stands, which is useful for exports that list the newest item last. Z to A sorts alphabetically in descending order, regardless of the starting order. Choose the one that matches what you need the list to show.

Sorting numbers

A list of plain numbers such as 5, 40 and 300 sorts correctly with the natural order option. Plain alphabetical order compares digit by digit and would place 300 before 40.

Alphabetical order in Indian names and titles

Name lists are often sorted by first name in India and by surname in many other countries. Decide which convention your list uses before sorting, and keep it consistent. For titles, people usually ignore leading words such as The when sorting, which you can do by editing those lines first.

Sorting before comparing lists

When two lists contain the same items in different orders, sort both the same way first. Afterwards, Text Compare shows only the items that are genuinely added or missing.

If something looks wrong

Item 10 appears before item 2
Choose Natural A to Z.
Capital letters are grouped first
Tick Ignore upper/lower case.
Blank lines moved to the top
Blank lines sort first. Remove them with Remove Duplicate Lines, which can drop blank lines.
Leading spaces change the order
Trim spaces first; a space sorts before letters.

Common questions

Can I sort by the second column?

No. It sorts whole lines.

Does reverse sort alphabetically?

No. Reverse flips the current order; use Z to A for reverse alphabetical.

Is my list saved?

No.

What is natural order?

Numbers inside text are compared by value, so item 2 comes before item 10. Plain alphabetical order would put item 10 first.

Does it remove duplicates?

No. Use Remove Duplicate Lines before or after sorting.

Are accented letters handled?

Yes. Sorting uses the browser’s language-aware comparison.

Lists are sorted in the page with your browser’s language rules; the text is not sent anywhere.