📝 Text Tools: Sort, Dedupe, Reverse

Quick line operations: sort, remove duplicates, reverse, shuffle, trim.

Last updated: June 9, 2026 · By Λ

Operations (run on input, write to output)

By Λ · Updated June 9, 2026 · ~3 min read

Why a text-ops tool exists

Every developer needs to sort or dedupe a list of strings several times a week. CSV column extraction, log analysis, deduping email lists, prepping a config file with no duplicates. Opening a Python REPL or piping through sort -u works, but it is faster to paste, click, and copy when you are in the browser already.

Operations explained

Chaining ops

The "use output as input" button lets you pipeline operations. Sort then dedupe; trim then remove empty lines; reverse each line then dedupe. The full sort | uniq -c equivalent is one button (Count occurrences).

How it works under the hood

The page splits your paste on newlines and hands the array to one small pure function per button. Sort numeric runs parseFloat on each line before comparing, Shuffle is a textbook Fisher-Yates pass driven by Math.random(), and both dedupe buttons walk the list once with a Set so the earliest occurrence wins. Count occurrences tallies identical lines, then prints count, tab, text per unique line, most frequent first. The stats row refreshes on every keystroke with total, non-empty, and unique line counts.

Each function executes against the textarea contents on your own machine, and the page fires no request carrying your text, so a pasted customer list stays with you.

Worked examples

The input box preloads a six-line sample: banana, apple, cherry, Apple, banana, date. Click Remove duplicates and five lines come back in their original order, with the second banana gone and Apple kept because the comparison is case-sensitive. Count occurrences instead returns 2, a tab, then banana on the first line, followed by the four single-count lines.

Sorting the same sample A-Z returns Apple, apple, banana, banana, cherry, date, since JavaScript compares UTF-16 code units and uppercase letters precede lowercase ones.

Limitations and edge cases

Sort numeric expects each line to begin with a number: v2 parses as NaN and can land anywhere, while 2.5kg parses as 2.5 and sorts fine. A trailing newline shows up as one extra empty line in the stats, which Remove empty lines clears. Shuffle relies on Math.random(), fine for ordering code reviews, wrong for anything security-related. There is no undo history, so copy intermediate results you care about.

Frequently Asked Questions

How many lines can I paste?

The operations handle hundreds of thousands of lines in under a second. The real ceiling is the textarea: with millions of lines, rendering becomes the slow part, not sorting.

Which copy survives a dedupe?

The earliest one. Later repeats drop, and in case-insensitive mode the surviving spelling is whichever variant appeared first.

Can I sort without worrying about capitalization?

Run lowercase first, feed the result back with the arrow button, then Sort A-Z. Original casing is lost in the process.

Why a tab between the count and the line?

Tab-separated output pastes straight into a spreadsheet as two columns, count and value, which makes frequency tables easy to filter or chart.

Related

For Markdown-specific operations, see markdown TOC and markdown editor. For JSON, see JSON formatter. For regex, see regex tester.