Text Manipulation Tool
Reverse, sort, dedupe, trim, shuffle. Ten common line-based text operations in one place.
Common text-cleaning tasks
List manipulation comes up daily for anyone working with data, content, or scripts. Most operations have command-line equivalents (sort, uniq, head, tac, awk) but this tool covers the highest-frequency ones in the browser without context-switching.
Operations explained
Reverse text
Reverses every character. “Hello” → “olleH”. Includes whitespace and punctuation. For palindrome checking, comparing reversed text to original works.
Reverse line order
Last line becomes first, etc. Each line stays intact. Equivalent to tac on Linux.
Sort A→Z / Z→A
Alphabetical sort using locale-aware comparison. Numbers sort lexically (“10” before “2”); for natural numeric sort, prefix numbers with leading zeros first. Equivalent to sort / sort -r.
Sort by length
Shortest line first. Useful for spot-checking long outliers or when working with words/codes of varying length.
Remove duplicates
Keeps first occurrence, drops repeats. Preserves original order otherwise. For sorted-and-deduplicated, run sort then dedupe (or use sort + uniq on Linux).
Trim whitespace
Strips leading and trailing spaces/tabs from each line. Doesn't collapse internal whitespace. Useful for cleaning up data exports where each line has trailing spaces.
Remove blank lines
Drops any line that's empty or only whitespace. Compresses spacing in messy text.
Add line numbers
Prefixes each line with its 1-based number. Useful for emails, code reviews, references.
Shuffle
Random reordering using Fisher-Yates (uniform). Each click of “Re-shuffle” gives a fresh random order. Uses Math.random() — fine for casual use, not crypto-secure.
Common workflows
- Clean a copy-pasted email list: trim whitespace, remove blank lines, sort, remove duplicates.
- Pick a random winner from entries: paste names, shuffle, take the first line.
- Check if a word is in a list: paste list, sort A→Z, scan visually.
- Generate sequential references: paste content, add line numbers.
- Find length outliers: sort by length, look at the extremes.
Programmatic alternatives
For scripts and large files, command-line tools are usually faster:
sort file.txt | uniq— sort and remove consecutive duplicatestac file.txt— reverse line orderrev file.txt— reverse each line's charactersshuf file.txt— shuffle (random sort)nl file.txt— add line numbers (orcat -n)awk 'NF' file.txt— remove blank linessed 's/^[[:space:]]*//;s/[[:space:]]*$//'— trim whitespace
For other text tools: Word Counter for length and reading time, Character Counter for social-media limits, Title Case Converter for case styles.