Skip to content
YouNeed Tools
Free VPN

Sort Lines

Put any list in order: A to Z, the way people count numbers, by price or length, backwards, or in a fair random order.

Sort

Sorted on your device. Your text isn’t sent anywhere.

Worked example: file names and prices

Four chapter files sorted alphabetically come out as Chapter1.docx, chapter10.docx, chapter11.docx, chapter2.docx: the 1 in “chapter10” is compared with the 2 in “chapter2”, so ten lands before two. The natural sort gives Chapter1.docx, chapter2.docx, chapter10.docx, chapter11.docx, the order you would expect. For a list of prices, sorting by number with Reverse ticked puts the most expensive first: $1,250 laptop; $450 monitor; $89 headphones; $15.50 cable; free sticker. The line with no number at all stays at the end.

The sort orders

OrderWhat it doesGood for
NaturalLetters A–Z, digits by their valueFile names, versions, addresses, chapter lists
AlphabeticalCharacter by character, A–ZWord lists, glossaries, names
By numberThe first number on each linePrices, scores, measurements
By lengthShortest line firstFinding odd entries, keyword lists
ShuffleA random order, every order equally likelyDraws, quizzes, running orders

Letters from other languages

The alphabetical and natural orders follow the Unicode collation rules for English, so accented letters sort next to their plain letter (é with e) rather than after z, as a simple character-code sort would put them. Other languages have their own conventions (Swedish puts å, ä and ö after z), so for lists in those languages check the result.

Shuffling fairly

A shuffle is only fair if every order is equally likely. Many quick methods, such as sorting by a random number, are subtly biased. This tool walks the list from the end, swapping each line with a randomly chosen line at or before it (the Fisher–Yates method), using random numbers from your device’s security system rather than a predictable formula. Press “Shuffle again” for a new order; nothing is stored, so nobody can repeat or predict it.

Everyday uses

  • Bibliographies and glossaries: paste the entries and sort them alphabetically; accented names sort with their plain letters.
  • Leaderboards and price lists: sort by number, largest first, without having to move the figures to the start of each line.
  • Draws and running orders: shuffle a list of names to pick a winner, a speaking order or teams, fairly and without anyone being able to predict it.
  • Tidying code: sort import lines, CSS properties or configuration keys, and remove duplicates at the same time.
  • Spotting oddities: sort by length to bring empty-looking lines, very short entries and pasted mistakes to the top.

Nothing is sent anywhere, so lists of names and e-mail addresses stay on your device.

Capital letters and ties

By default capitals are ignored when deciding the order, so “apple”, “Banana” and “cherry” sort A, B, C, the way a dictionary or an index does. With “Capitals first” ticked, a word in capitals comes before the same word in small letters (“Apple” before “apple”), which matches what many programming tools and older spreadsheets do. Lines that are exactly the same stay next to each other, so the remove-duplicates option can drop the extra copies in the same step. When sorting by number, lines with the same number are put in natural order among themselves, and when sorting by length, lines of the same length are too.

Related tools

Sources

Checked on November 26, 2026:

Frequently asked questions

How do I put a list in alphabetical order?
Paste the list with one item per line and choose Alphabetical or Natural. Natural is usually what people want: it sorts letters A to Z and numbers by their value, so item 2 comes before item 10.
What is natural sort?
A natural sort reads runs of digits as numbers. Plain alphabetical order compares character by character, so “file10” comes before “file2” because 1 is less than 2. Natural order gives file1, file2, file10, the way a person would count.
How does sorting by number work?
Each line is sorted by the first number in it, including decimals, negative numbers and thousands separators, so “$1,250 laptop” counts as 1250. Lines without a number go to the end.
Is the shuffle really random?
Yes. It uses the Fisher–Yates method with your device’s secure random number source, so every order is equally likely. That makes it fair for drawing names, picking a running order or randomising quiz questions.
Do capital letters change the order?
Not by default: “apple”, “Banana” and “cherry” sort A, B, C. Tick “Capitals first” for the case-sensitive order some programs use, where capitals come before small letters of the same word.
Can I sort and remove duplicates at the same time?
Yes, tick “Remove duplicates”. Lines that differ only in capitals are treated as the same unless capitals are set to count.

Last updated: 2026-11-26