Skip to content
toolwise

Sort Lines

Sort lines alphabetically, by length, numerically or randomly.

When to use it

Sort Lines puts a list in order: alphabetically, by number, by length, reversed or shuffled. Use it to alphabetise names for a class list or guest list, order prices or scores from highest to lowest, sort keywords, tidy a bibliography, randomise the order of quiz questions or presentation slots, or flip a list that’s upside down.

How to sort lines

  1. Paste your list into Your text, one item per line, or press Example.
  2. Choose how to Sort:
    • A to Z or Z to A
    • Numbers, smallest first or Numbers, largest first
    • Shortest first or Longest first
    • Reverse current order or Random shuffle
  3. Tick Ignore capital letters or Remove empty lines if needed.
  4. Read the Sorted lines, then press Copy result or Download .txt.

A worked example

You have the results of a fun run as lines like “Maya – 24:31”, “Leo – 22:05” and “Sam – 27:48”. Choose Numbers, smallest first: the tool uses the first number on each line (the minutes), so Leo, Maya and Sam appear in finishing order. For an alphabetical list of runners instead, choose A to Z.

Tips

  • Put the value you sort by first in each line when sorting numbers, such as “24:31 Maya”.
  • Remove duplicates first with Remove Duplicate Lines if the list has repeats.
  • Use Random shuffle for fair speaking orders or to mix quiz questions.
  • Keep a copy of the original order if it means something, such as sign-up time.

Sorting by length

Shortest first and Longest first are handy for spotting outliers: very long lines in a keyword list, the shortest product names for a narrow menu, or empty-looking entries that are really just a few spaces. Lines of equal length keep a natural alphabetical order.

Common mistakes

  • Sorting several columns pasted from a spreadsheet; whole lines are sorted, which may not be what you want. Sort in the spreadsheet for multi-column data.
  • Expecting dates to sort correctly in A to Z order when written as 3/12/2026. Use the year-month-day format (2026-12-03) for reliable sorting.
  • Leaving “Ignore capital letters” off when a list mixes “apple” and “Banana” and you want them in plain alphabetical order.

Private by design

Your list is sorted in your browser and never uploaded.

Remove repeats with Remove Duplicate Lines, count items with the Line Counter, or pick random entries with the Random Name Picker.

Frequently asked questions

How are numbers sorted?

"Numbers, smallest first" and "largest first" use the first number on each line, so 2 comes before 10 and "Item 3" comes before "Item 12". Commas in numbers like 1,250 are handled. Lines without any number go to the end.

Why do A to Z results put "item10" after "item9"?

The A to Z sort is natural, so numbers inside text are compared as numbers. That gives the order people expect, rather than the computer-style order of item1, item10, item2.

Is the random shuffle really random?

Yes. It uses your browser's secure random number generator, so every order is equally likely. Press it again for a new order.

What does "Reverse current order" do?

It flips the list upside down without sorting it, so the last line becomes the first.

Is my list uploaded?

No. Sorting happens in your browser.