Sort Lines

Sort lines A to Z, Z to A, numerically, by length, or shuffle them.

Sort the lines of any text alphabetically (A to Z or Z to A), numerically, by line length, or shuffle them randomly. Results update live as you type.

Loading tool…

If the tool stays on this message, make sure JavaScript is enabled, then reload the page.

About Sort Lines

An unsorted list is a small annoyance multiplied by a hundred rows: attendees to alphabetize, bibliography entries to order, keywords to arrange, or a raffle list to randomize. Doing it by hand is tedious and error-prone, and spreadsheet sorting means importing and exporting for a thirty-second job. Paste the text here and choose how to order it, A to Z, Z to A, numerically, by line length, or a full random shuffle, with results updating live as you type.

Each mode has its job. Alphabetical is the default for names, titles, and terms. Numeric sorting reads the number at the start of each line, so '10 apples' correctly lands after '2 apples' instead of before it; lines without numbers drop to the end. Sorting by length is a niche but handy trick for formatting poetry or finding outliers in data. The shuffle uses a Fisher-Yates algorithm, meaning every possible ordering is equally likely, fair enough for raffles, team picks, and randomized test order.

The sorted version appears in a separate result box, so your input, and its original order, is always a glance away if you need it back. Copy or download the result when it's right, and the source text is still sitting there untouched for the next experiment.

How to use Sort Lines

  1. Paste your text, one item per line.
  2. Choose a sort mode such as A to Z or numeric.
  3. Copy or download the sorted result.

Why use this tool?

  • Five sort modes including shuffle
  • Live results as you type
  • Free with no signup

Tips for best results

  • Use numeric mode for numbered lists, it puts '10' after '2' instead of sorting alphabetically.
  • Shuffle with confidence for raffles and team picks; Fisher-Yates gives every ordering equal probability.
  • Sort by length to spot outliers, like an unusually long entry hiding in a data column.
  • Clean duplicates first with remove-duplicate-lines so you're sorting the final list.
  • Your input stays untouched. Copy the result elsewhere rather than re-pasting over it.

Frequently asked questions

How does numeric sorting work?
Lines are ordered by the number at the start of each line; lines without numbers go last. So '2 apples' correctly comes before '10 apples'.
Is the shuffle truly random?
It uses a Fisher-Yates shuffle, so every ordering is equally likely, fair for raffles and random draws.
Does sorting change my input?
No. Your input stays as-is and the sorted version appears in the result box.
Why does '10' sort before '2' in some tools?
Plain alphabetical sorting compares character by character, so '1' comes before '2'. Use this tool's numeric mode to sort by actual number value instead.

Related tools