BrowserTools

Sort Lines

Alphabetical, numeric, length or reverse sorting

By Guga — BrowserTools maintainer, Tbilisi, Georgia Updated 2026-08-18
Free Private No uploads
What is Sort Lines?

Four different meanings of sorted, and picking the wrong one is the usual reason a sorted list looks wrong. Alphabetical uses a locale-aware comparison, so capitals, accents and punctuation are handled the way a dictionary would rather than by raw character code. Numeric ignores everything except digits, a decimal point and a minus sign, which is what you want for a list like item 2, item 10, item 33 — string sorting would put item 10 before item 2. Length order is by character count. Shuffle is a genuine randomisation with no seed, so re-running it gives a different order. Descending and unique filters are available where they make sense, and the numeric, length and shuffle orders skip blank lines entirely. The same dropdown also carries the deduplication and line-removal operations.

Sort lines alphabetically, numerically, by length, in reverse or shuffled — with case-insensitive and unique options. Ideal for lists, spreadsheets, code imports and keyword lists.

Private Sort Lines In Your Browser

Sort Lines is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.

Step-by-Step

How to use Sort Lines

1

Paste your list into the Input box; the number of non-empty lines shows under the label.

2

Choose the order from the Operation dropdown — alphabetical, numeric, by length or shuffle.

3

Tick Descending to reverse any of the three orders, or Unique only to collapse repeats first.

4

Read the ordered list from the Result panel and copy it.

Key Capabilities
  • Alphabetical, numeric, by-length and random orders from one dropdown
  • Locale-aware alphabetical comparison rather than raw character codes
  • Ascending or descending, plus a unique-only filter applied before ordering
  • Blank lines dropped by the numeric, length and shuffle orders
Common Use Cases
  • A developer ordering a list of version numbers that are padded with text, such as release 9 and release 10.
  • A researcher alphabetising interview participants by surname before anonymising them.
  • A teacher demonstrating the difference between alphabetical and numeric ordering to a class.
Clear Answers

Frequently Asked Questions

Why did item 10 come before item 2 alphabetically?
Because that order is alphabetical, not numeric: it compares the letters I-t-e-m and then the characters after the space, where 1 comes before 2. Switch the operation to numeric and the values are read as numbers instead of text, giving item 2, item 10, item 33 in the order you expected.
How does numeric sorting read a line?
It strips out every character except digits, a decimal point and a minus sign, then parses what is left. That handles version prefixes, currency symbols and trailing units, so $19.99 and 19.99 USD both sort as nineteen point ninety-nine. A line with no digits at all has nothing to compare and is placed last when sorting upwards.
Is the shuffle repeatable?
No, and deliberately so. It is a random permutation with no seed or undo, so pressing the same settings twice gives a different order each time. That is what makes it useful for drawing a random sample and useless for reproducing a result you already have.
What does the Unique only filter do in sort mode?
It removes repeats before the ordering is applied, keeping the first occurrence, and it works alongside the ignore-case option when both are ticked. The result is a sorted list that also happens to be deduplicated, rather than a sorted list with duplicates left in place.