Sort Lines and Lists

Put names, keywords, products or any list into order in one click – alphabetically, by the number in each line, by length, or in a fair random shuffle.

  • Files stay on your device
  • Free, no sign-up
  • Instant
Options
Clean-up

Processed on your device. Your files are not uploaded to any server.

Quick guide · 4 steps

How to use the Sort Lines (Alphabetical Order)

When to use the Sort Lines (Alphabetical Order)

Names and contact lists

Put a class list, guest list or contact list into alphabetical order.

Keyword research

Sort and de-duplicate keyword lists from several tools.

Numbered items

Order file names, versions or product codes correctly with natural sorting.

Fair draws

Shuffle names for a raffle, presentation order or team selection.

Features and benefits

  • A–Z, Z–A and natural order (item 2 before item 10)
  • Sort by the number inside each line, or by length
  • Fair random shuffle using secure randomness
  • Optional de-duplication, trimming and empty-line removal

Example

Input
item 10
Item 2
item 1
item 2
Output
Natural, duplicates removed:
item 1
Item 2
item 10

How the Sort Lines (Alphabetical Order) works

Your text is split into lines, optionally trimmed, emptied of blank lines and de-duplicated. Alphabetical modes use the browser’s Intl.Collator, which knows the rules of your language for accents and case. Natural and numeric modes compare numbers by value. The shuffle uses the Fisher–Yates algorithm with numbers from crypto.getRandomValues, so every possible order is equally likely.

A real-life example

A teacher has a list of 34 students copied from two spreadsheets, with some names twice and inconsistent spacing. She pastes it here, chooses A → Z, ticks “Remove duplicates” and keeps trimming on. The clean 31-name list goes straight into her attendance sheet. Later, she uses “Shuffle randomly” to choose presentation order fairly.

Good to know

Simple alphabetical sorting puts “item 10” before “item 2” because it compares character by character. Natural order understands numbers inside text and gives the order people expect.

Sorting uses your browser’s language-aware comparison, so accented letters (é, ü, ñ) sort next to their plain versions instead of at the end of the list. Case-insensitive sorting is the default; tick “Case-sensitive” to keep capitals first.

Shuffle uses the Fisher–Yates algorithm with cryptographic random numbers, so every order is equally likely – fair for prize draws, quiz questions and team picks.

Tips for the best results

  1. Use natural order for file names like “photo 2” and “photo 10”.
  2. Keep “Trim spaces” on for lists copied from spreadsheets.
  3. Tick case-sensitive only when capitals matter, such as codes.
  4. Copy the result back into your spreadsheet column in one paste.

Common mistakes to avoid

Sorting comma-separated text

Sorting works line by line. Put each item on its own line first.

Using A → Z for numbers

Plain alphabetical order puts 10 before 9. Use natural or numeric order.

Removing duplicates with case-sensitive on

“Ali” and “ali” then count as different. Turn it off to merge them.

Sort Lines (Alphabetical Order) – frequently asked questions

How do I sort numbers correctly?

Choose “By number in the line” or “Natural”. Both treat 10 as bigger than 9.

Can I sort and remove duplicates at once?

Yes. Tick “Remove duplicates” together with any sort order.

Is the shuffle truly random?

It uses your browser’s secure random generator and an unbiased shuffle.

Can I sort a column from Excel?

Yes. Copy the column, paste it here and paste the result back.

How are accented letters sorted?

Next to their plain letters, following your browser’s language rules.

Can I sort by the last word?

Not directly. Use Find and Replace to move the last word to the front first.