My Tool Studio
Text

Sort Text Lines

Forty attendee names sit in signup order and the printed sheet needs them alphabetized. Paste them in, pick Alphabetical A to Z, and you're done. This page lets you sort lines online in six modes: alphabetical in either direction, numerical ascending or descending, by line length, or shuffled into random order. The numerical modes matter more than they look, because when you sort text alphabetically, a line starting with 10 lands before a line starting with 2. And as an a to z sorter it uses locale aware comparison, so accented names file where a human would put them.

Always freeNo sign upRuns in your browser

How to use

01

Enter one item per line

Type or paste your list into the Input textarea on the left, one entry per line. Names, numbers, URLs, or file paths all work the same way.

02

Pick a sort mode

Choose from the six radio options below the panes: Alphabetical A to Z or Z to A, Numerical ascending or descending, By line length, or Shuffle randomly.

03

Grab the result

The Sorted pane updates the moment you change modes. Use the Copy button above it to take the ordered list, or the Clear button to wipe the input.

Why Sort Text Lines

Common questions

Why does 10 come before 2 when I sort lines alphabetically?
Alphabetical mode compares character by character, and the character 1 sorts ahead of 2, so 10 files before 2 just as aa files before b. Switch to Numerical ascending and the lines compare as values instead, putting 2 before 10.
Does the alphabetical sort work in reverse?
Yes. Select Alphabetical Z to A and the order flips. It remains the quickest way to sort list online when you need reverse alphabetical output for rankings, countdowns, or dated file names.
How does sorting lines numerically treat decimals and negatives?
Each line is parsed as a number first, so -3, 2.5, and 10 order correctly as -3, then 2.5, then 10. Lines that don't begin with a digit have no numeric value and can land unpredictably in this mode, so strip labels before switching to it.
What is the By line length sort mode useful for?
It orders lines from shortest to longest by character count. Developers use it to spot outliers in slug lists or arrange CSS selectors, and writers use it to find which headlines blow past a length budget.
Can I shuffle a list instead of sorting it?
Yes, the Shuffle randomly option rearranges your lines into a random order. It's handy for picking a fair speaking order or randomizing quiz questions. Editing the input or switching modes and back produces a fresh shuffle.
Does sorting lines handle accents and mixed capitalization sensibly?
The alphabetical modes use locale aware comparison, so an accented e sorts beside a plain e, and apple sits next to Apple rather than being pushed into a separate block the way a raw byte sort would arrange them.
Are duplicates kept when I sort lines online?
Every line survives the sort, including repeats, which end up stacked together. That adjacency makes them easy to spot, and the Remove Duplicate Lines tool can strip them in one paste afterward.

More Text tools

View all