Skip to content

Menu

Line Sorter

Sort, shuffle, deduplicate, and clean up text lines with pipeline operations

Runs entirely in your browserText & DiffFree, no sign-up
Loading tool

01What is Line Sorter?

Line Sorter is a small pipeline for text that comes one item per line. You paste a list, then click operations in the order you want them applied. The choices are Sort A → Z, Sort Z → A, Reverse, Shuffle, Remove Duplicates, Remove Empty and Trim. Each click adds a chip under the toolbar, and the output updates right away. Order matters, which is why it is a pipeline and not a set of checkboxes. Trim followed by Remove Duplicates catches "react" and "react " as the same entry. Run them the other way round and both survive. You can drop any step with its × or wipe the lot with Clear all. Sorting uses natural order. Under the hood it calls JavaScript's localeCompare with the numeric option, which comes from the ECMAScript Internationalization API. Runs of digits compare as numbers, so item2 lands before item10. Letters follow your browser's locale rules, so éclair sits right after eclair and not at the very end. The Case-sensitive checkbox changes two things. With it off, both sorting and duplicate removal compare lowercased text. Apple, apple and APPLE count as one entry, and the first spelling seen is the one kept. With it on, they stay separate. Even then, locale sorting keeps a and A side by side instead of putting every capital first like ASCII order would. Here is a worked case. Paste item10, item2, Item1 and item1, then click Sort A → Z with Case-sensitive off. You get Item1, item1, item2, item10. The two Item1 lines compare equal, so they keep their original relative order. Shuffle uses a Fisher-Yates shuffle driven by crypto.getRandomValues, so every order is equally likely. It reshuffles whenever the input or settings change. The output panel shows line counts before and after, and highlights lines that did not exist in the input, which makes Trim's effect easy to spot. Limits are worth knowing up front. There is no sort by line length, no sort by a chosen column, and no strict byte order. If you need output identical to Unix sort with LC_ALL=C, this will not match it. Your list stays in the page. Nothing is posted to a server while you sort.

Developers tidying imports and dependency lists, and analysts deduplicating email or URL lists pulled from several exports. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Line Sorter

  1. Paste your text into the Input panel, one item per line, or load one of the examples
  2. Click operations in the order you want them, for example Trim, Remove Empty, Remove Duplicates, Sort A → Z
  3. Tick Case-sensitive if Apple and apple should be treated as different lines
  4. Remove a step with its × on the chip, or click Clear all to start over
  5. Click Copy to take the output

03Worked examples

Input: Sort A → Z, Case-sensitive off: item10 item2 Item1 item1
Result: Item1 item1 item2 item10
Natural order puts item2 before item10. Item1 and item1 compare equal and keep their original order.
Input: Sort A → Z, Case-sensitive on: b B a A
Result: a A b B
Locale order keeps each letter's cases together instead of all capitals first.
Input: Sort Z → A: v1.10.0 v1.9.2 v1.2.0 v2.0.0
Result: v2.0.0 v1.10.0 v1.9.2 v1.2.0
Digit runs compare as numbers, so 1.10 ranks above 1.9.
Input: Sort A → Z, Case-sensitive off: éclair eclair zebra Ezra
Result: eclair éclair Ezra zebra
Accented letters sort next to their plain forms.
Input: Remove Duplicates, Case-sensitive off: Apple apple APPLE pear
Result: Apple pear
The first spelling seen is kept. With Case-sensitive on, all four lines stay.
Input: Remove Empty: a, an empty line, a line of three spaces, b
Result: a b
Lines containing only whitespace count as empty.

04Common use cases

  • Alphabetising a block of import statements or package names before committing
  • Deduplicating email addresses or URLs collected from several exports
  • Sorting release tags like v1.9.2 and v1.10.0 in natural version order
  • Cleaning a pasted .env file by trimming whitespace and dropping blank lines
  • Sorting CSV rows by their first field, since the whole line is compared from the left
  • Reversing a log excerpt so the newest entries appear at the top

05Tips

  • Put Trim before Remove Duplicates. Otherwise lines that differ only by trailing spaces survive as separate entries.
  • Natural sort handles version tags well, but it reads v1.10.0 as numbers split by dots, not as semver. Pre-release tags like -rc.1 will not follow semver rules.
  • Case-insensitive duplicate removal keeps the first spelling it sees, so put your preferred casing near the top.
  • Shuffle redraws whenever you edit the input, so copy the output once you have an order you like.

06Related concepts

Fisher-Yates shuffle, Natural sort order, Text processing, Unix sort.

Frequently Asked Questions

What is Line Sorter?

Line Sorter is a free, browser-based developer tool on AIDToolStack. Sort, shuffle, deduplicate, and clean up text lines with pipeline operations It requires no installation or sign-up and works entirely in your browser.

Is Line Sorter free to use?

Yes. No sign-up, no fees and no usage cap.

Does Line Sorter store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe