Sort Lines Online

Sort lines of text alphabetically, numerically, by length, in reverse or shuffled, with options to remove duplicates and empty lines.



Lists rarely arrive in the order you need them. Names are jumbled, numbers are scattered, and duplicates hide inside long text blocks. This line sorter tidies any list in seconds: paste it in, pick a sorting method, and copy out a clean, ordered version. Everything runs in your browser, so even private lists — customers, students, inventory — stay on your device.

Sorting Methods

Alphabetical A to Z handles names, titles and keywords, while Z to A reverses the order. Numeric sort understands numbers properly, so 10 comes after 9 rather than after 1, and it works for prices, scores and IDs. Sort by length lines items up from shortest to longest, useful for headlines or hashtags. Shuffle randomises the order for draws and games, and reverse simply flips the list top to bottom. Two tidy-up options ride along: remove duplicates and remove empty lines.

How to Sort Your Lines

  1. Paste your list into the box, one item per line.
  2. Choose a method: A–Z, Z–A, numeric, by length, shuffle or reverse.
  3. Optionally tick case-sensitive sorting, remove duplicates, or remove empty lines.
  4. Check the sorted output.
  5. Copy it or download it as a text file.

Everyday Uses

Teachers alphabetise class lists. Shopkeepers sort product names before printing labels. Writers order keywords and references. Anyone running a giveaway shuffles entries fairly. Developers clean test data, sort log lines and dedupe ID lists before feeding them into scripts.

Frequently Asked Questions

Does numeric sort handle decimals and negatives?

Yes. Lines that start with a number are compared by their numeric value, including decimals and negative numbers. Lines without numbers are grouped together.

What does case-sensitive sorting change?

With it off, Apple and apple sort as equals. With it on, capital letters sort before lowercase ones, which matters for passwords and code identifiers.

Can I recover the original order after shuffling?

No — shuffling is random and the original stays only in your input box until you change it, so keep a copy if the first order matters.

Related Tools

More Text Tools