How to Sort Lines of Text Alphabetically

A messy list is hard to use. Names entered in no order, a jumble of items, a column of data that needs organizing — sorting lines puts them in order alphabetically or numerically so the list becomes scannable and consistent. It sounds simple, but a few details decide whether the result is what you expected. This guide explains sorting options and the gotchas that surprise people.

What sorting does

Sorting rearranges the lines of your text into order — A to Z, Z to A, or numerically. Each line is treated as an item, and the tool reorders them without changing their content. A tangled list becomes an orderly one in a click.

How to sort lines with this tool

  1. Open the Sort Lines tool.
  2. Paste your list, one item per line.
  3. Choose the sort order and options.
  4. Copy the sorted result.

Everything runs in your browser — nothing is uploaded.

The options that matter

The number gotcha

The classic surprise: sorting numbers *as text*. Alphabetical sorting compares character by character, so `10` comes before `2` because "1" comes before "2". A list of `1, 2, 10, 21, 100` sorted as text becomes `1, 10, 100, 2, 21` — clearly wrong for numbers. If your lines are numeric, use a numeric sort option so values order by size, not by their first digit. This trips up nearly everyone at least once.

Where sorting helps

Related tools

Clean the list first: Remove Extra Spaces trims stray whitespace that can throw off sorting, and Remove Duplicate Lines collapses repeats. Normalize case with Convert Case so case variants sort together. Reverse the whole thing with Reverse Text if you need it flipped.

Common uses

Privacy and limits

Sorting is fully local — no upload, nothing stored, offline once loaded. Open the Sort Lines tool to organize your list.