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
Sort Lines Jun 25, 2026

Why Stable Sorting Matters — Multi-Key Composition, Algorithm Stability, and the JavaScript Array.sort Change

A stable sort preserves the relative order of equal elements — which enables multi-key sorting by composing stable sorts. Sort by amount first, then by date (stable): the final result is ordered by date, with amount order preserved within each date. Here's which algorithms are stable (merge sort, Timsort, insertion sort) vs unstable (quicksort, heapsort), why JavaScript's Array.sort stability changed in 2018, and why numbers stored as text sort "10" before "2".

Remove Duplicate Lines Jun 25, 2026

What Does "Duplicate" Actually Mean? The Normalization and Merge Decisions Behind Effective Deduplication

Deduplication is a business logic decision masquerading as a technical one — "duplicate" means different things for contact lists (same email, different fields) vs URL lists (case sensitivity, trailing slashes) vs product catalogs (same SKU, different descriptions). Here's the exact vs near-duplicate distinction, normalization as the preprocessing step that determines deduplication quality, CRM merge strategies, and URL-specific case sensitivity rules.

Morse Code Translator Jun 23, 2026

AR, SK, and 73: The Prosigns and Q Codes That Make Morse Code a Complete Communication Protocol

Morse code prosigns — like AR (end of message / "over"), SK (signing off / "out"), and KN (only the named station should reply) — are a complete communication protocol built into the code. Q codes like QTH (location), QSL (confirm receipt), and QRP (low power) provide internationally standardized shorthand that works across language barriers. Here's how a complete amateur radio Morse contact (QSO) is structured, and why 73 means "best regards."

Lorem Ipsum Generator Jun 23, 2026

Why Lorem Ipsum Is Statistically Biased for English Layouts — and When Content-First Design Is Better

Lorem Ipsum's Latin word-length distribution is statistically different from English, which is why layouts that look balanced with placeholder can break with real copy. Here's the average word length across languages, why button and navigation placeholder text is particularly misleading, how Cicero's long-sentence rhetorical style differs from web copy, and when content-first design eliminates the placeholder problem entirely.

Find & Replace Jun 23, 2026

Regex Works on Characters, Not Structure — Why It Fails on CSV, HTML, and JSON (and What to Use Instead)

Regex operates on characters, not structure — and applying it to CSV, JSON, or HTML routinely produces wrong results because the same pattern can appear in both structural positions (delimiters, field names) and content positions (inside field values). Here's why commas inside quoted CSV fields confuse naive regex, the HTML-parsing-with-regex problem, when regex on structured text is actually acceptable (log files, single-field formats), and the correct parsers for each format.

Word & Character Counter Jun 23, 2026

Word Count Isn't a Ranking Factor — Here's What Competitor Word Count Analysis Is Actually For

"Write 2,000+ words to rank" is confident, specific advice with weak evidence — longer pages rank well because comprehensive answers to complex questions require more words, not because length itself is a ranking signal. Here's how to actually use competitor word count data (look at the range, understand why longer pages are longer), why word count is a useful writing discipline tool in academic and professional contexts, and when character count matters more than word count.

Text to Slug Jun 22, 2026

When Changing a Slug Is Worth the SEO Cost — and the Exact Sequence to Follow When It Is

Changing a URL slug after publishing has permanent SEO consequences — but so does keeping a slug that contains a wrong date, a discontinued product name, or a keyword that's shifted. Here's when slug changes are genuinely warranted (vs when they're not worth the disruption), the correct 301-redirect-then-update-internal-links sequence, why CMS auto-slug-regeneration on title edit destroys rankings, and why year-in-slug is almost always a decision you'll regret.

ROT13 Encoder Jun 21, 2026

Beyond ROT13: ROT47, ROT18, Atbash, and the Complete Family of Caesar-Style Rotation Ciphers

ROT47 extends ROT13 to all 94 printable ASCII characters — rotating digits and punctuation in addition to letters — but remains identically trivial to decode. Here's the full Caesar cipher family (ROT5 for digits, ROT13 for letters, ROT18 for both, ROT47 for all printable ASCII), Atbash's Hebrew origins (it appears in the Bible as the first known cipher in a religious text), and the modern use cases where ROT13 is deliberately not meant to be secure.

Remove Duplicate Lines Jun 21, 2026

The Algorithm Behind "Remove Duplicates": Sort-Then-Scan vs Hash-Set, and When Each Is Right

"Remove duplicates" in a sorted list is a different operation than in an unsorted list — and which you need determines whether you must sort first, and whether you can process in a single pass. Here's the sort-then-scan vs hash-set trade-off (O(n log n) memory-efficient vs O(n) order-preserving), the "which occurrence to keep" question, and two edge cases most people don't think about until they hit them: blank lines and case sensitivity.

Case Converter Jun 21, 2026

Why Your Database Uses snake_case, Your JSON Uses camelCase, and Your .env Uses SCREAMING_SNAKE_CASE — and What Breaks When You Mix Them

Database column names, JSON fields, environment variables, and CSS classes each use different casing conventions — and each choice reflects a constraint from where that identifier is used. Here's why PostgreSQL lowercases your column names, the JSON snake_case vs camelCase cross-ecosystem problem, why environment variables are SCREAMING_SNAKE_CASE, and the file-name case-sensitivity bug that works on macOS and breaks on Linux production servers.

Character Frequency Jun 19, 2026

How Counting Characters Can Identify a Language — and Why It Gets More Reliable With Every Word

A character-counting algorithm can identify a language from a short text sample because every language has a dramatically different character frequency signature — English peaks at E (12.7%), German at E (17.4%) with distinct umlauts, Spanish with high A and the ñ character. Here's how n-gram comparison against language profiles works, why accuracy improves with text length, where language detection fails (code-switching, similar languages, proper nouns), and applications beyond language detection.

Whitespace Cleaner Jun 18, 2026

Why Copy-Paste From PDFs and Word Docs Silently Breaks Your Database: The Invisible Character Problem

A non-breaking space (U+00A0) looks identical to a regular space but doesn't trim with standard .trim(), doesn't match in string comparisons, and passes "not empty" validation on fields that look blank to users. Here's the taxonomy of invisible Unicode characters that cause real data quality bugs (not security exploits — the accidental kind from PDF and Word paste), where they come from, the specific bugs they cause, and how to reliably detect and clean them.