Skip to main content
Toollyz

Search tools

Search for a command to run...

Line Sorter

Sort any list — A→Z, natural (image2 before image10), by leading number, by length or shuffled. Case toggles, dedupe-after-sort and blank-line handling included.

What is the Line Sorter?

Line Sorter takes any newline-separated list and re-orders it ten different ways. Standard alphabetical (A→Z and Z→A) uses the platform's Intl.Collator so Unicode collation matches the user's locale. Natural sort orders 'image2.png' before 'image10.png' by recognising embedded numbers. Numeric sort pulls the leading number out of each line and sorts on that — non-numeric lines fall to the end. Length sort orders by visible character count. Shuffle uses crypto.getRandomValues for a cryptographically strong Fisher-Yates shuffle, and reverse simply flips top↔bottom. Options layer on top: case-sensitive vs case-insensitive comparison, ignore-leading-whitespace (so indentation doesn't poison the sort), drop blank lines, and dedupe after sorting. Stats track input lines, kept lines, blanks dropped and duplicates dropped. Pure functions, no network.

How to use it

  1. Paste your list (one item per line) into the input panel.
  2. Pick a sort method — A→Z, natural, by number, by length, shuffle or reverse.
  3. Toggle case-sensitive, ignore-leading-spaces, drop-blank-lines and dedupe-after-sort as needed.
  4. Copy the sorted output, download as .txt, or feed it back as the new input.

Benefits

  • Ten sort methods covering alpha, natural, numeric, length, random and reverse.
  • Natural sort orders 'img2' before 'img10' the way humans expect — powered by Intl.Collator with numeric:true.
  • Numeric sort pulls leading numbers out and sorts on the parsed float; non-numeric lines go last.
  • Shuffle uses crypto.getRandomValues — a cryptographically strong Fisher-Yates, falling back to Math.random where unavailable.
  • Case-sensitive toggle controls whether 'Apple' and 'apple' sort together or apart.
  • Ignore-leading-spaces option keeps indented lists from sorting wrong.
  • Optional dedupe-after-sort step strips repeated entries in one pass.
  • Runs entirely in your browser — your list never leaves the device.

Frequently asked questions

How does natural sort differ from A→Z?

Plain A→Z compares character-by-character, so 'image10' comes before 'image2'. Natural sort recognises embedded numbers and orders them numerically, putting 'image2' before 'image10' — the way a human would expect.

How does numeric sort handle non-numeric lines?

It pulls the leading number from each line; lines that don't start with a number are pushed to the end (or beginning in descending mode) and sorted alphabetically among themselves.

Is the shuffle truly random?

Yes — Toollyz uses `crypto.getRandomValues` to seed a Fisher-Yates shuffle, which is the standard cryptographically-strong shuffle algorithm. On platforms without the WebCrypto API it falls back to Math.random.

What does 'ignore leading spaces' do?

It strips leading whitespace from each line before comparing, so an indented list like a code outline sorts on the content rather than the indentation level.

What's the difference between case-sensitive and case-insensitive?

Case-sensitive sort uses 'variant' collation (Apple, apple are distinct). Case-insensitive uses 'base' collation so they sort together — typical for human-readable lists.

Will it sort emoji and non-Latin text correctly?

Yes. The standard alpha modes use Intl.Collator with locale-aware Unicode comparison, so accents and non-Latin scripts collate in the order your browser's locale expects.

Can I run shuffle twice to get a different order?

Yes — click the shuffle button again and the seed bumps, producing a fresh random order.

Does it preserve duplicates by default?

Yes. Sorting does not remove duplicates unless you tick 'Dedupe after sorting'.

What does 'reverse' do?

It simply flips top↔bottom — no sort. Useful for inverting an already-sorted list.

Does this run on the server?

No. Sorting is a pure browser computation — Toollyz has no backend that sees your list.

How big a list can I sort?

Comfortable up to hundreds of thousands of lines. The bottleneck is browser memory rather than the algorithm itself.