Text Toolkit
Sort, dedupe, trim, number, prefix, wrap and shuffle lines. Chain the operations in any order and see the line count change after each step.
Runs entirely in your browser — nothing is uploadedPipeline
2 steps applied in orderInput
Drop a file or click to browse
or drop a text fileOutput
About the Text Toolkit
Eleven line operations — trim, remove empty lines, remove duplicates, sort, reverse, shuffle, prefix/suffix, number lines, tabs ↔ spaces, wrap and unwrap — that you stack into a pipeline instead of running one at a time. Each step is a numbered card showing its settings and how many lines went in and came out, so a chain like *trim → remove blanks → dedupe → sort* is visible as four steps rather than four separate round-trips through four separate tools. Steps can be reordered with the arrow buttons, switched off temporarily with their On/Off toggle, or removed entirely, and the output updates as you edit.
Order is the thing people get wrong, and it changes the answer. Removing duplicates compares lines as exact strings, so apple and apple are two different lines: dedupe before trimming and both survive, trim before deduping and they collapse into one. The same applies to blank lines — a line of three spaces is not empty until something trims it. Because the pipeline shows each step's before-and-after count, a step that removed nothing is obvious at a glance, which is usually the clue that two steps are in the wrong order. That is why the Sort & unique preset also leaves *Ignore case* switched off on its dedupe step: deleting a line is destructive and silently merging Banana into banana is a bad default, so the toggle is there and visible rather than assumed.
A line is text ending in a newline, and that trailing newline is preserved. Splitting on \n naively produces a phantom empty element at the end of any file that ends properly, which "remove empty lines" then eats — and the file comes back missing its final newline, which is exactly the invisible change that shows up as \ No newline at end of file in a code review. This tool strips one terminator before operating and puts it back afterwards. Mixed CRLF and LF endings in one paste are detected and reported, since the output can only use one style; the Line endings control decides which.
Two more places where the obvious implementation is wrong, and this one is not. Expanding a tab is not replacing \t with four spaces — a tab advances to the next tab stop, so a tab sitting at column 3 with width 4 becomes one space, not four; the naive substitution silently shifts every column on any line where a tab did not start at a stop. And converting spaces back to tabs only ever touches leading indentation, because rewriting interior runs of spaces would wreck aligned tables, ASCII art and the inside of string literals, and no heuristic makes that safe. Sorting is equally fussy: numeric sort reads the first number in each line (Item 100 after Item 9) and parks lines with no number at the end in their original order rather than letting NaN scramble the comparison, length counts code points so an emoji is one column and not two, and every sort is stable, so equal lines keep the order you gave them.
The shuffle is seeded and reproducible — the same seed always produces the same order, so you can share a seed and get the same result twice — which also means it is a deterministic PRNG and not a source of cryptographic randomness. Do not use it to pick winners or generate secrets.
Everything runs inside your browser using standard web APIs. Your data is never uploaded, never stored on a server, and never leaves your device — you can confirm that by opening your browser devtools Network tab, or by switching off your Wi-Fi and using the tool offline.
Frequently asked questions
In what order do the operations run?
Strictly top to bottom, in the numbered order shown on the cards. Use the ↑ and ↓ buttons to move a step, and the On/Off button to skip one without deleting it. Order genuinely changes the result — sorting then numbering gives you numbers in sorted order, while numbering then sorting sorts the lines by their number text.
Why weren't 'apple' and ' apple' treated as duplicates?
Remove duplicates compares lines as exact strings, and those two are not the same string. Either add a Trim whitespace step before it, or switch on Ignore spacing on the dedupe step itself, which compares lines with leading and trailing whitespace ignored while leaving the text untouched.
Why does 'Sort & unique' keep both Banana and banana?
Its dedupe step has Ignore case switched off on purpose. Removing a line throws data away, so the conservative behaviour is the default and the toggle is visible on the card rather than hidden in the preset. Turn Ignore case on for that step and the two collapse. The sort in the same preset is case-insensitive, because sort order only affects presentation and nothing is lost.
Does it preserve the newline at the end of my file?
Yes. A trailing newline is a line terminator, not an extra blank line, so it is removed before the operations run and restored afterwards. Files that ended with a newline still do; files that did not, still do not. If your input mixes CRLF and LF the tool says so, because the output has to pick one — use the Line endings control to choose.
Is there an undo?
No undo history, but nothing is destructive: the input pane is never modified, so the original text is always sitting there. To back out one change, switch that step Off with its toggle or delete just that card; everything else stays as it was.
How much text can it handle?
Hundreds of thousands of lines are fine — 200,000 lines through a sort, dedupe and numbering chain takes a fraction of a second. There is no Web Worker, though, so everything runs on the page's main thread and a multi-megabyte paste will briefly freeze the tab each time you change the pipeline. Above about 2 MB the tool warns you about this rather than letting it look like a crash.
What happens if I drop a file that isn't UTF-8?
It tells you instead of quietly mangling it. UTF-16 files with a byte-order mark are decoded correctly, a UTF-8 BOM is stripped, and a file that is not valid UTF-8 — a Windows-1252 export, say — is reported with a count of the characters that could not be decoded, rather than handing back text full of replacement characters that looks almost right.
Can I use a tab or a newline as a prefix or separator?
Not directly — the prefix, suffix, separator and join fields are taken literally, so typing a backslash and a t inserts those two characters rather than a tab. To indent every line with a real tab, paste an actual tab character into the field.