Text Tools
Count / Diff / Dedupe / Case · 10 tools
Text tools exist because the same string can be correct in one context and broken in another: invisible characters, mixed line endings, duplicate lines, four different definitions of "character count". These tools make the invisible visible and the inconsistent consistent.
Most of them are line-oriented — they split on newline, transform each line, and join again. That is the right model for logs, lists, CSV columns and config files, and the wrong model for prose. The regex tester is the exception: it works on the whole input and shows every match with group captures.
Which one do I need?
- Counts that do not match another tool: start with the counter. It reports UTF-16 code units, code points, UTF-8 bytes and grapheme clusters separately, which explains most disagreements instantly.
- A shell script failing with "bad interpreter": run it through the whitespace trimmer and look for carriage returns. A CRLF file keeps a hidden \r at the end of every line.
- Cleaning a pasted list: the dedupe and line tools handle duplicates, blank lines, sorting and numbering — each toggle independent, so you can remove blanks without touching duplicates.
- Renaming many files or fields: the naming converter moves between camelCase, snake_case, kebab-case, PascalCase and CONSTANT_CASE, and flags the inputs where the mapping is ambiguous.
- Bulk edit with a pattern: the regex and replace tools, in that order — test the pattern first, then apply it.
All tools in this category
Guides in this category
- Why counters disagree: characters, code points, bytes, and grapheme clustersCount characters, Chinese/English, lines, paragraphs, UTF-8 bytes and estimated reading time
- How text diffing works: the LCS algorithm, line-level comparison, and noiseFind added and removed lines between two versions, side by side
- Line dedupe and sort: the boundaries of exact matching and common surprisesRemove blank lines and duplicate lines, optionally sort alphabetically
- The five case conversions: title case and sentence case are not the sameConvert between UPPERCASE, lowercase, capitalize first, title case and sentence case
- Naming-style conversion: the five styles and the traps in betweenConvert among camel / Pascal / snake / kebab / CONSTANT styles in one click
- Batch line processing: prefixes, suffixes, line numbers, and keyword filteringBatch add prefix/suffix and line numbers; remove or keep lines containing keywords
- Find and replace: the difference between plain text and regex modeSupport plain text and regex, optional case-insensitive, replace everywhere
- Regex tester: flags, greedy matching, and backtracking trapsHighlight matches in real time, show capture groups, with g/i/m toggles
- HTML entity encode and decode: when escaping is mandatory and when it is notConvert between special characters and & < and other HTML entities
- Whitespace cleaner: the six cleanup actions and where they applyTrim ends, collapse spaces, remove all whitespace, remove tabs, convert CRLF/LF
FAQ
Why do I get four different character counts?
They measure different things. UTF-16 code units are what JavaScript string length returns, so an emoji outside the BMP counts as 2. Code points count Unicode scalar values. UTF-8 bytes matter for storage limits and database columns. Grapheme clusters count what a human perceives as one character, including combining marks and emoji sequences.
Why should I not parse HTML with a regular expression?
HTML is not a regular language. Optional closing tags, nested identical elements and attribute quoting rules all break patterns that look correct on the sample you tested. Use a parser and query the DOM. Regular expressions are fine for flattening, extracting a known field, or quick triage — not for correctness.
Should I validate an email address with a regular expression?
Not strictly. The full grammar allows quoted local parts and comments, so a pattern that accepts every valid address is unreadable and still not future-proof; a pattern that is readable rejects valid addresses. Check for an @ and a dot as a UX hint, then send a confirmation mail — that is the only real verification.