Skip to content

Sort Lines

Paste a list and put it in order instantly: alphabetical A→Z or Z→A, numeric, by line length, reversed, or shuffled at random. Ignore case, trim spaces, drop blank lines and duplicates while you sort. Everything happens in your browser.

Runs in your browserFreeNo sign-up

Processed on your device. Files and text stay in your browser and are not uploaded to our servers. How privacy works

How to use the sort lines

  1. Paste or type your list with one item per line. The sorted version appears immediately on the right.
  2. Pick an order: A→Z, Z→A, numeric (by the number at the start of each line), shortest or longest first, reverse, or shuffle.
  3. Optionally ignore case, trim surrounding spaces, remove empty lines and remove duplicate lines.
  4. Copy the result, download it as a text file, or click “Use as input” to chain another operation.

Features

  • Natural alphabetical sorting so item 2 comes before item 10
  • Numeric sort that understands signs, decimals and thousands separators
  • Sort by length, reverse the current order, or shuffle with cryptographic randomness
  • Case-insensitive matching, trimming, blank-line and duplicate removal
  • Line counts in, out and removed, plus copy and download

How each order works

A→Z and Z→A use locale-aware comparison with numeric collation, so “file2” sorts before “file10” and accented letters land next to their plain equivalents. Numeric order looks at the number at the start of each line (for example “12 mangoes” or “-3.5”), sorts by its value, and places lines without a leading number at the end. Length order counts characters as people see them, so an emoji counts as one.

Shuffle uses the browser's cryptographic random generator with a Fisher–Yates shuffle, which gives every arrangement the same chance. Press “Shuffle again” for a fresh order.

Common uses

Alphabetising a bibliography or a list of names, ordering CSS properties or import statements, ranking scores stored one per line, randomising a list of participants for a draw, or cleaning a keyword list before pasting it into a spreadsheet.

Frequently asked questions

Does it sort words within a line or whole lines?

Whole lines. Each line is treated as one item. To sort words, put one word per line first (for example with the find-and-replace tool, replacing spaces with line breaks).

Why does “item 10” come after “item 2” instead of before it?

Because the tool uses natural sorting, which compares numbers inside text by value rather than character by character. Most people expect 2 before 10, which plain ASCII sorting gets wrong.

Can I sort numbers with commas or decimals?

Yes. Numeric mode reads the number at the start of each line, including a minus sign, a decimal point and thousands separators such as 1,000.

Is the shuffle truly random?

It uses crypto.getRandomValues, the same generator used for encryption keys, so the order is unpredictable and not biased towards any arrangement.

Other tools people use alongside Sort Lines.

You might also like

Something useful from another corner of VoltKit.