Skip to content
SPCXTools

Sort Lines

Put any list in alphabetical, numerical or random order in one click.

Runs locally — files never leave your device

Loading tool…

How to use Sort Lines

  1. 1Paste your list into the Input box, one item per line.
  2. 2Choose an order — A → Z, Z → A, by number, by length, reversed or shuffled.
  3. 3Tick the options you need, such as Ignore case or Remove duplicates.
  4. 4Copy the sorted list or download it as a text file.

Sort any list instantly

Names for a class roster, keywords for a campaign, product SKUs, bibliography entries, to-do items, file names — lists are easier to scan and compare when they're in order. This tool sorts lines of text alphabetically, numerically or by length, reverses them or shuffles them randomly. It can remove duplicates, empty lines and stray spaces in the same step, and it handles accents and non-Latin scripts correctly.

Features

  • Eight orders: A→Z, Z→A, by leading number in either direction, by length in either direction, reverse and random shuffle.
  • Natural sorting: "file2" comes before "file10".
  • Language-aware comparison for accented letters and all scripts.
  • Ignore case, remove duplicates, remove empty lines and trim spaces options.
  • Line count of the result.
  • Copy or download the sorted list.

Examples

Input Order Result
banana, Apple, cherry A → Z (ignore case) Apple, banana, cherry
Item 10, Item 2, Item 1 A → Z Item 1, Item 2, Item 10
15 USD, 3 USD, 120 USD By number 3 USD, 15 USD, 120 USD
kiwi, fig, banana By length fig, kiwi, banana

Ideas

  • Alphabetize a bibliography or glossary before pasting it into a document.
  • Order survey answers or keywords to spot near-duplicates.
  • Randomize a list of names for presentations, seating or team order — or use Spin the Wheel to pick one at a time.
  • Rank scores with "By number (high → low)".

Related tools

Remove repeated lines without sorting with Remove Duplicate Lines, join a list into one line with Remove Line Breaks, or change the capitalization of every line with the Case Converter.

Frequently asked questions

How are numbers inside text sorted?
The alphabetical sort is "natural", so numbers inside words are compared by value — "Item 2" comes before "Item 10", not after it as in a simple character-by-character sort.
What does "by number" do?
It sorts lines by the number at the start of each line, such as prices, scores or IDs, including negative numbers and decimals. Lines that don't start with a number are placed at the end in alphabetical order.
Does it sort accented letters and other languages correctly?
Yes. Sorting uses your browser's language-aware collation, so é is sorted with e, ß with ss, and Chinese, Japanese, Korean, Cyrillic and other scripts follow the conventions for the page language.
How does Ignore case work?
With Ignore case, "apple" and "Apple" are treated as equal when sorting and when removing duplicates. Without it, they're different items, and uppercase comes first when they're otherwise the same.
Is the shuffle really random?
Yes. It uses a Fisher–Yates shuffle driven by your browser's cryptographically secure random number generator, so every order is equally likely. Click Shuffle again for a new order.