Remove Duplicates Remove repeated lines instantly Text Cleaner Remove formatting & clean text Word Frequency Find top words by frequency
Sort Mode
Options
0 lines
0 lines
How It Works
  1. 1Paste your list — one item per line — into the Input box.
  2. 2Pick a sort mode: A→Z, Z→A, Shortest, Longest, or Random.
  3. 3Toggle options: case-insensitive, trim spaces, remove duplicates.
  4. 4Click "Copy result" and paste your sorted list anywhere.

What is a Sort Lines Tool?

This tool splits whatever you paste into separate lines — one item per line — and reorders them by the rule you pick: A to Z, Z to A, shortest to longest, longest to shortest, or a random shuffle. Four toggles refine the result: case-insensitive comparison, whitespace trimming, removing blank lines, and deduplication. The output rebuilds the instant you type or change a setting, so there's no button to hunt for.

How to Alphabetize a List Online — Step by Step

  1. Paste your list. Drop your items — one per line — into the Input box. The Sorted output rebuilds on every keystroke, so you see the result as you paste.
  2. Choose a sort mode. Pick A → Z, Z → A, Shortest first, Longest first, or Random shuffle from the panel on the left. Switching modes re-sorts the current input immediately.
  3. Refine with the option toggles. Turn on "Case-insensitive" to treat "Apple" and "apple" as equal. "Trim whitespace" strips stray leading and trailing spaces before sorting. "Remove empty lines" drops blank rows, and "Remove duplicates" deduplicates in the same pass — so you can dedupe and alphabetize at once.
  4. Copy and paste. Hit "Copy result" and paste the sorted list into a document, spreadsheet, code file, or CMS.

Sort Modes Explained — Examples

Input list Sort mode Output
Tokyo
Berlin
Madrid
Oslo
Cairo
A → Z (alphabetical) Berlin
Cairo
Madrid
Oslo
Tokyo
Tokyo
Berlin
Madrid
Oslo
Cairo
Z → A (reverse alphabetical) Tokyo
Oslo
Madrid
Cairo
Berlin
Tokyo
Berlin
Madrid
Oslo
Cairo
Shortest first (by character count) Oslo
Cairo
Tokyo
Berlin
Madrid
Tokyo
Berlin
Madrid
Oslo
Cairo
Longest first (by character count) Berlin
Madrid
Tokyo
Cairo
Oslo
Tokyo
Berlin
Madrid
Oslo
Cairo
Random shuffle Cairo
Tokyo
Oslo
Madrid
Berlin
(order varies each run)

Related Tools

Frequently Asked Questions

Why does "10" sort before "9" when I sort numbers?

Sorting is lexicographic (character by character), not numeric. The tool compares the first character of each line: "1" comes before "9", so "10", "11", and "100" all land ahead of "9". To get true numeric order, pad your numbers with leading zeros (009, 010) before sorting, or use a spreadsheet's numeric sort.

How does case-sensitivity change the A–Z order?

By default the sort is case-sensitive, so all uppercase letters rank before lowercase ones — "Banana" lands before "apple" because capital "B" has a lower code point than lowercase "a". Tick "Case-insensitive" to compare letters by value regardless of capitalization, which gives the dictionary-style order most people expect.

What's the difference between length sort and alphabetical sort?

"Shortest first" and "Longest first" rank lines purely by character count, ignoring the letters themselves — so "zoo" sorts ahead of "apple" because it is shorter. Lines of equal length keep their original relative order. It's handy for lining up table columns or spotting an unusually long or short entry in a dataset.

How are blank lines and whitespace handled?

"Trim whitespace" (on by default) strips leading and trailing spaces before sorting, so " apple" and "apple" sort together. "Remove empty lines" drops blank rows entirely instead of clustering them at the top or bottom. Leave both off and empty lines are kept and sorted as zero-length strings — which, in length mode, places them first.