Text Tools

Words, precision
and power.

The details behind text processing, encoding, and document formats.

✦ 108 Articles ✦ Updated Weekly ✦ Free to Read
✦ AI

✦ AI-powered — understands natural language

Find & Replace Sep 11, 2026 Latest ✦

Word Boundaries and Lookarounds: Precise Find & Replace

Replacing "id" also hits valid, hidden and width. Word boundaries, lookarounds and lazy quantifiers are the three patterns that make find-and-replace precise.

Read article
Lorem Ipsum Generator Jun 18, 2026

Where Lorem Ipsum Actually Comes From: Cicero, a Mid-Word Cut, and Centuries of Corruption

"Lorem ipsum" isn't a real Latin phrase — it's literally the tail end of "dolorem ipsum" ("pain itself"), cut off mid-word from a genuine passage of Cicero's philosophy, then scrambled and partially invented over centuries of typesetting. Here's the actual source text, how a coherent philosophical passage became nonsense, and why the "fakeness" arguably works in its favor as placeholder text.

Case Converter Jun 18, 2026

Title Case Isn't One Rule: How AP, Chicago, and MLA Disagree on Prepositions and Hyphens

"The Art of War" or "The Art Of War"? AP style capitalizes 4+ letter prepositions; Chicago and MLA lowercase all prepositions regardless of length. Here's how major style guides disagree on prepositions, why hyphenated compounds are the hardest case for any automated title-case tool, and why "to" as an infinitive marker needs different treatment than "to" as a preposition.

Text Truncator Jun 18, 2026

Why Truncating Text at "Exactly 100 Characters" Is Harder Than It Looks: UTF-8, Word Boundaries, and HTML

Truncating at exactly 100 characters sounds simple — until you're splitting a multibyte UTF-8 sequence and producing invalid text, cutting mid-word and leaving "fo" dangling, or cutting HTML and leaving unclosed tags. Here's the byte vs code point vs grapheme cluster distinction, the word-boundary backtracking algorithm, why HTML truncation requires an actual parser (not string slicing), and why your ellipsis length has to come out of the character budget before you cut.

Text Diff Jun 18, 2026

Why Text Diff Tools Work at Line Level (Not Character Level): Edit Distance, Granularity, and the Unified Diff Format

The simplest possible text diff — "what characters changed?" — is the Edit Distance problem, with an O(n×m) solution too slow for document-scale text. This is why practical diff tools work at line level, with a second character-level pass only within changed lines. Here's how granularity (character, word, line, sentence, structural) changes both what's shown and what's computationally feasible, the unified diff format explained, and why structured diffs for JSON/HTML need tree-level comparison rather than line-level.

Character Frequency Jun 17, 2026

Huffman Coding: How "E Is the Most Common Letter" Becomes Smaller ZIP Files and PNG Images

Every ZIP file, PNG image, and gzip-compressed page relies on the same observation as the previous article's frequency analysis: characters aren't equally frequent, so assigning shorter codes to common symbols and longer codes to rare ones saves space. Here's how Huffman coding builds optimal variable-length codes from frequency data, why "prefix-free" codes need no separators, how this fits into larger compression pipelines like DEFLATE, and why already-compressed data resists further compression.

Character Frequency Jun 17, 2026

Frequency Analysis: How Counting Letters Breaks Caesar Ciphers, Substitution Ciphers, and Why Modern Encryption Is Immune

A Caesar cipher can be broken in seconds — not by trying all 25 shifts, but by counting which ciphertext letter appears most often and matching it against English's most common letter, "E." Here's how frequency analysis breaks substitution ciphers, why polyalphabetic ciphers like Vigenère were designed to defeat it, and why modern encryption (AES, RSA) is immune to this entire category of attack.

Find & Replace Jun 17, 2026

Find & Replace Beyond Basics: Regex Capture Groups, Multi-Cursor Editing, and Safe Project-Wide Replace

Find-and-replace with regex capture groups doesn't just substitute text — it can restructure it, swapping argument order or reformatting dates by reusing captured values in the replacement. Here's how capture-group replacements work, when multi-cursor editing is the better tool instead, case-modification syntax for naming-convention conversions, and safe practices for project-wide replace operations.

Text Reverser Jun 17, 2026

Reversing Text Has Three Completely Different Meanings — Here's How Each Works and When You'd Use It

Reversing text has three completely different interpretations: reverse every character, reverse word order, or reverse line order — and each produces different output from identical input. Here's where each is actually used (character reversal for palindromes, line reversal for the Unix tac command and log files), the palindrome variants that require different reversal types, and why reversing Arabic/Hebrew code points is different from displaying them right-to-left.

ROT13 Encoder Jun 17, 2026

Why ROT13's Encode Button and Decode Button Do the Same Thing — and Why That's the Point

ROT13 shifts each letter by 13, and shifting by 13 again returns you to the start — because 13 is exactly half of 26, and the English alphabet has 26 letters. This self-inverse property means "encode" and "decode" are literally the same operation, which is exactly why ROT13 became the standard for Usenet spoilers and forum answers: one button, symmetric, no separate decode tool needed. Here's the math, the variants (ROT5, ROT18, ROT47), and where self-inverse operations appear elsewhere.

Sort Lines Jun 17, 2026

Alphabetical Sort Order Isn't Universal: Locale Collation, Swedish Å, and Why Your Database Might Be Sorting Wrong

Alphabetical sort order isn't the same in every language — Swedish Å, Ä, Ö go at the end of the alphabet; German has two competing sort conventions for umlauts; Spanish ñ sits between n and o. Most sort tools and database defaults use Unicode code-point order, which is correct for English and wrong for nearly every other language. Here's what locale-sensitive collation actually is, how to configure it in SQL, JavaScript, and Python, and the case/accent-sensitivity dimensions on top of letter ordering.

Whitespace Cleaner Jun 17, 2026

Trailing Whitespace and Git Diff Noise: Why a One-Line Fix Can Show 200 Lines Changed

A one-line bug fix can show up as a 200-line diff if an editor's "trim trailing whitespace on save" setting touches every line in a file that previously had inconsistent trailing whitespace. Here's why this happens, git's whitespace-ignoring diff flags, dedicated "cleanup commit" practices for git blame hygiene, and the Markdown exception where trailing whitespace is actually meaningful.

Text Diff Jun 16, 2026

How Plagiarism Detection Actually Works: From Exact-Match Shingling to Semantic Similarity, and Why Each Has Limits

Plagiarism-detection software doesn't search for "stolen sentences" — it converts text into mathematical representations (shingles, vectors, embeddings) and measures distance between them. Here's how exact-match shingling catches copy-paste-with-edits but misses paraphrasing, why semantic-embedding similarity catches paraphrasing but can't distinguish "copied" from "independently expressed similarly," and why similarity scores require human judgment to interpret.