Sort Lines Alphabetically Online

Order any list of lines from A to Z or Z to A, sort numbered lists naturally, and clear out duplicates and blank lines in one pass. Everything runs in your browser, so your text stays on your device.

0characters0words0lines
Result
0characters0words0lines

About sorting lines

What does sorting lines do?

Sorting lines takes a list where each entry sits on its own line and reorders it alphabetically. It's the quick way to clean up a messy list of names, tags, imports, or keywords without doing it by hand. You can sort A to Z or Z to A, keep numbers in a sensible order, drop repeated entries, and strip out blank lines, all in one click.

Why use our line sorter

  • ·Free. No signup, no paywall, no limits.
  • ·Runs in your browser. Nothing gets uploaded, your text stays with you.
  • ·Natural number order. Sorts item2 before item10 the way you'd expect.
  • ·Cleans as it sorts. Remove duplicates and blank lines in the same step.
  • ·Live stats. See character, word, and line counts as you go.

Options explained

Ignore case

Treats uppercase and lowercase as the same when ordering, so 'apple' and 'Apple' sit next to each other instead of all capitals coming first. Turn it off for a strict A to Z where capitals lead.

Beforebanana↵ Apple↵ cherryAfterApple↵ banana↵ cherry

Natural order

Sorts numbers inside text the way a person would, so 'item2' comes before 'item10'. Without it, a plain sort puts 'item10' first because it compares character by character.

Beforeitem10↵ item2↵ item1Afteritem1↵ item2↵ item10

Remove duplicates

Drops repeated lines so each entry appears once. Because the list is sorted first, matching lines end up next to each other and the extras are cleared out.

Beforered↵ blue↵ red↵ greenAfterblue↵ green↵ red

Remove blank lines

Clears out empty lines so they don't stack up at the top or bottom of the result. Useful when your pasted list has extra gaps between entries.

Beforepear↵ ↵ apple↵ ↵ Afterapple↵ pear

Trim lines

Removes spaces from the start and end of each line before sorting. Useful for lists copied from code or spreadsheets where extra indentation would mess up the order.

Before pear↵ apple ↵ bananaAfterapple↵ banana↵ pear

When to sort lines alphabetically

A quick alphabetical sort saves time whenever a list needs to be readable or deduped. Here are the most common reasons people use a line sorter:

  • ·Cleaning up a list of names or terms. Put attendees, tags, or glossary entries into order so they're easy to scan and search.
  • ·Ordering imports and config. Sort import lines, dependency lists, or environment keys so diffs stay clean and entries are easy to find.
  • ·Deduping a keyword list. Sort and remove duplicates to turn a messy dump of keywords or emails into a clean, unique list.
  • ·Alphabetizing a bibliography. Order references or citations by their first letter without moving lines around by hand.
  • ·Sorting numbered items. Turn on Natural order to keep step 2 ahead of step 10 in a numbered list or file listing.

Frequently asked questions

How do I sort lines alphabetically?
Paste your list into the box above, choose your options, then click A to Z. The tool orders every line alphabetically and you can copy the result or download it as a .txt file. Click Z to A to reverse the order.
How do I sort text in reverse alphabetical order?
Click the Z to A button instead of A to Z. The lines are sorted alphabetically and then flipped, so they run from Z down to A.
Can I sort a numbered list correctly?
Yes. Turn on 'Natural order' so numbers inside the text are compared as numbers rather than characters. That way 'item2' comes before 'item10' instead of after it.
How do I remove duplicate lines while sorting?
Turn on 'Remove duplicates'. The list is sorted first, which puts identical lines next to each other, then the repeats are removed so each line appears only once.
Does sorting keep uppercase and lowercase separate?
By default 'Ignore case' is on, so 'Apple' and 'apple' are ordered as if they were the same. Turn it off for a strict sort where capital letters come before lowercase ones.
Is the sort lines tool free?
Yes, it's completely free with no signup, no limits, and no watermarks. Use it as often as you like.
Is my text safe and private?
Your text never leaves your browser. All processing runs locally on your device, so nothing is uploaded to a server. Once the page has loaded you can even use it offline.