Skip to content
SmaftyTools

Line Sorter

Sort lines A-Z, Z-A, by length, numerically or shuffle them randomly. Free online line sorter with duplicate and blank-line removal.

About Line Sorter

The Line Sorter reorders a list of lines alphabetically (A-Z or Z-A), by length (shortest or longest first), numerically, or shuffles them into random order — with optional duplicate removal and blank-line stripping applied on top of any sort. It's a one-paste alternative to opening a spreadsheet just to click a sort button.

It's used for alphabetizing a list of names or references before publishing, sorting a set of keywords or tags by length to find the shortest ones for a character-limited field, numerically ordering a column of IDs or scores that would sort wrong as plain text (where '10' sorts before '2' alphabetically), and shuffling a list of raffle entries, quiz questions or team names into random order for a fair draw. Combined with duplicate removal, it also works as a quick way to get a sorted, deduplicated list in a single pass rather than sorting and deduplicating separately.

Numeric sorting extracts the leading number from each line and sorts by that value, so a line like '10 items' sorts correctly as ten, not as the string '10' compared character-by-character against '2 items' — the exact failure mode that makes plain alphabetical sort put '10' before '2'. Random shuffling uses a proper randomized in-place shuffle (each position has an equal chance of landing anywhere), not a naive sort-by-random-key approach, which can be measurably biased for smaller lists.

Case-insensitive sorting treats 'Apple' and 'apple' as equivalent when deciding order, which matches how most people expect an alphabetized list to read — without it, every uppercase letter sorts before every lowercase letter in standard string comparison, which can put 'Zebra' before 'apple' in a way that looks wrong to a human reader even though it's technically correct ASCII order. Sorting runs entirely in your browser.

How to Use the Line Sorter

  1. Paste a list of lines, one item per line.
  2. Choose a sort order: A-Z, Z-A, shortest/longest first, numeric, or shuffle.
  3. Optionally enable case-insensitive sorting, duplicate removal, or blank-line removal.
  4. Copy the sorted list.

Features

  • Alphabetical (A-Z / Z-A), length-based, numeric and random sort orders
  • Case-insensitive sorting option
  • Optional duplicate and blank-line removal applied alongside sorting
  • True randomized shuffle, not a biased sort-by-random-key

Examples

Alphabetizing a name list

Input

Charlie
Alice
Bob

Output

Alice
Bob
Charlie

Sorting numerically instead of alphabetically

Input

10 items
2 items
1 item

Output

1 item
2 items
10 items

Shortest-first for a character-limited field

Input

ecommerce
seo
marketing

Output

seo
marketing
ecommerce

Frequently Asked Questions

Why does numeric sort exist separately from alphabetical sort?

Plain alphabetical sorting compares text character by character, so '10' sorts before '2' because '1' comes before '2'. Numeric sort reads the leading number on each line and compares by actual value instead, so 2 correctly comes before 10.

Is the shuffle option truly random?

Yes — it uses a proper in-place shuffle algorithm where every line has an equal probability of ending up in any position, rather than a naive method that can be statistically biased.

Can I sort and deduplicate in the same pass?

Yes — turn on 'Remove duplicates' alongside any sort order to get a sorted, unique list in one step instead of running two separate tools.

Is the line sorter free?

Yes, the line sorter is completely free with no usage limits. No signup, no account and no installation required.

Is my data safe?

Yes. All processing happens locally in your browser using JavaScript — nothing you type is uploaded or stored on our servers.