Text tools

Sort lines alphabetically online.

Put a list in alphabetical order — A→Z or Z→A — with options to ignore case and drop blank lines.

0 lines0 chars
Sort by
Result
0 lines0 chars

What sorting lines does

Sorting arranges your lines into order. A → Z puts them in ascending alphabetical order and Z → A reverses that. Two options refine the result: Ignore case treats "Apple" and "apple" as equal so capitals don't clump at the top, and Drop blank lines clears empty rows so your list stays tidy.

What you'd use it for

Alphabetizing is one of those small chores that shows up everywhere: putting a list of names, tags, or keywords in order; tidying an import list before pasting it into a spreadsheet; organizing bullet points; or arranging a glossary. Sorting also makes duplicates sit next to each other, which is handy if you're about to clean a list.

How it handles case, numbers, and blanks

By default, sorting is alphabetical (lexicographic), comparing text character by character. That means "10" sorts before "9", because it compares "1" against "9" — so for purely numeric lists, expect dictionary order rather than numeric order. Turn on Ignore case to fold uppercase and lowercase together, and Drop blank lines to remove empties instead of floating them to one end.

Sorting vs. the other line tools

Sorting only reorders lines — it never changes or deletes their contents (unless you drop blanks). If you also need to remove repeats, run remove duplicate lines afterwards; if you want random order instead of alphabetical, use shuffle lines.

How to use it

Paste your lines, choose A → Z or Z → A, toggle the options you want, and the sorted result appears instantly. Copy it or download a .txt. Everything runs in your browser — nothing is uploaded.

Worked examples

Numbers that sort wrong. Plain alphabetical order compares character by character, so "Chapter 10" lands before "Chapter 2". Choose Natural (2 before 10) to sort the numbers by value:

Chapter 10
Chapter 2
Chapter 1
Chapter 1
Chapter 2
Chapter 10

Shortest to longest. Length orders lines by how many characters they have (ties are alphabetical). It's useful for tidying keyword lists or finding the longest entry. Pick Z→A for longest first.

strawberry
fig
banana
kiwi
fig
kiwi
banana
strawberry

A clean, alphabetical, unique list. Tick Remove duplicates and Remove blank lines to turn a messy paste into a sorted list with each item once.

Sorting in Excel or Google Sheets instead

In a spreadsheet, select the column and use Data → Sort A to Z (Excel) or Data → Sort range (Google Sheets). Use this page when your list is plain text (from an email, a document or code) and you want sorted text back without opening a spreadsheet.

More text tools

Related free tools: reverse text · sort lines · remove duplicate lines · shuffle lines · fancy text · text repeater.

To sort lines alphabetically, paste your list into the box. It's put in A→Z order instantly. Choose Z→A, natural number order (so 2 comes before 10), or sort by length, and optionally ignore case, remove duplicates or drop blank lines.
FAQ

Frequently asked.

It sorts alphabetically (lexicographically), so "2" comes after "10" because it compares character by character. For true numeric ordering you'd need a spreadsheet; this tool is built for text lists.

It treats uppercase and lowercase as equal, so "Banana" and "banana" sort together instead of all the capitalized words clumping at the top of the list.

No — sorting only reorders. To delete repeats, use the remove duplicate lines tool, which keeps the first of each unique line.

By default they're sorted along with everything else. Turn on "Drop blank lines" to remove empty rows from the result.

Yes. Click the Z → A option for descending order; A → Z gives ascending.

No. Sorting happens entirely in your browser and your text never leaves your device.

Choose “Natural (2 before 10)”. Plain alphabetical sorting compares text character by character, which puts 10 before 2; natural order compares the numbers by value.

Yes. Choose “Length” to sort shortest to longest, or pick Z→A as well for longest first. Lines of the same length are sorted alphabetically.

Yes. Tick “Remove duplicates” and each line appears once in the sorted result. For removing duplicates without sorting, use remove duplicate lines.

Yes. Drag a .txt or .csv file onto the box, or tap “Upload .txt”. It’s read in your browser and never uploaded.