Skip to main content
Tools Star Hub

Line Sorter

Sort lines A–Z, numerically or by length in your browser, with optional trim, empty-line skip and dedupe.

What is Line Sorter?

A line sorter orders multiline text alphabetically, numerically or by length, with optional duplicate removal.

Loading tool…

This tool runs in your browser. Inputs, files and generated values stay on this device. Favorites and recently used tools, if you use them, store only tool names in local storage — never passwords, documents or QR contents. See the privacy policy.

Line Sorter — Sort Text Lines Locally — Tools Star Hub

What this tool does

Sort one item per line from A to Z, Z to A, by a leading number, or by length. Use it when a name list or a numbered export should be in order without a spreadsheet. Numeric order puts 10 after 2, and a line with no leading number sorts after the numbered lines.

How to use

  1. Paste one item per line.
  2. Choose A→Z, Z→A, numeric order or length. Set case, trim, empty-line and duplicate options as needed.
  3. Press Sort lines. Equal items keep their original relative order.
  4. Copy or download the sorted list.

Examples

  • Names

    A→Z with case-insensitive matching puts ada and Ada next to each other while keeping the first spelling’s position when they compare equal.

  • Numbered rows

    Numeric ascending reads a leading number, so 10 follows 2. Lines without a number go after numbered lines.

How it works

Sorting is stable: when two lines compare equal, the earlier input line stays first. Numeric modes look at a leading integer or decimal. Optional dedupe uses the same comparison key as case and trim.

Limitations

The modes are A to Z, Z to A, numeric ascending, numeric descending, shortest, and longest. Equal lines keep their original order. Numeric mode reads a leading number, and a line without one sorts after the numbered lines. More than 400,000 characters is refused.

See the disclaimer for what these tools do not cover.

FAQ

Is the Line Sorter free?
Yes. Sorting a list of lines is free, with no account.
Is my input sent to a server?
No. Sorting runs in this tab. The lines are not sent to a server or saved in local storage.
Are empty lines kept?
Yes, unless you choose Ignore empty lines. They sort as empty strings in letter modes.
How do I sort a list alphabetically?
Paste one item per line and choose A to Z, or Z to A for reverse order. Lines that are equal keep their original order.
How do I sort lines by number?
Choose numeric ascending or descending. Each line is sorted by the number at its start, so 2 comes before 10.