Text transforms in everyday work
Plain text looks simple until you paste HTML from a page, copy a title with accents into a URL, or need a stable word count for a form limit. The Text utilities family covers those small, high-frequency jobs: normalize whitespace, strip markup, build slugs, reverse or truncate strings, count characters and words, and sanity-check URLs. Everything runs on the text you provide; there is no server-side rewrite of your drafts.
A good starting point for cleaning pasted copy is collapse whitespace, which turns messy runs of spaces, tabs, and line breaks into a single space so downstream tools see consistent tokens.
What this family is for
Text utilities sit between raw clipboard content and structured formats (JSON, Markdown, CSV). They answer questions like:
- How many characters or whitespace-separated words are in this string?
- Can I turn this heading into a URL-safe slug?
- What remains if I drop HTML tags or diacritics?
- Are these lines sorted, unique, or truncated for a preview?
- Does this string look like an HTTP(S) URL?
They are not full document editors, spellcheckers, or NLP pipelines. Prefer them when you want a deterministic, inspectable transform rather than a generative rewrite.
Normalization and cleanup
Whitespace. Editors, chat apps, and OCR often insert multiple spaces, mixed tabs, and Windows/Unix newlines. Collapse whitespace compresses runs; remove newlines flattens multiline paste into one line when a single-field form or search box cannot accept breaks.
Markup. Strip HTML removes angle-bracket tags and leaves visible text for plain-text previews or exports. It is a pragmatic tag stripper, not a full HTML sanitizer for untrusted content in a security boundary.
Accents. Remove accents strips diacritics toward ASCII-friendly keys (filenames, search tokens, legacy systems). Unicode edge cases and some scripts will not map cleanly to Latin letters; treat the output as a convenience encoding, not a lossless round-trip.
Slugs, URLs, and identity of strings
Slugify turns titles into lowercase hyphenated paths suitable for blog permalinks and file names. Slugs are conventions, not guarantees of uniqueness or SEO ranking. Empty input cannot become a meaningful slug.
Validate URL checks whether a string matches common HTTP/HTTPS patterns (hostnames, IPv4, typical path shapes). A “valid” result means the string looks well-formed for everyday web use; it does not prove the host exists, TLS certificates are correct, or the resource is safe to open.
Counting, splitting, and structure
Length and word metrics support copy limits and readability checks:
- Count characters counts every character, including spaces and punctuation.
- Count whitespace (word count) splits on whitespace for a practical word total.
- Reading time estimates silent reading minutes from word count at about 238 wpm.
- Split vowels and consonants extracts Latin vowels and consonants for linguistics drills and word games—not a full phonology model for every language.
- Case convert rewrites identifiers between camel, snake, kebab, Pascal, and constant styles.
- Extract emails pulls unique addresses from pasted notes or logs with a practical matcher.
Line-oriented helpers help when tools emit one item per line:
- Sort lines applies locale-aware alphabetical order.
- Unique lines deduplicates while preserving first-seen order—useful for ID or URL lists.
Playful and preview transforms
Leetspeak applies classic letter substitutions (a→@, e→3, i→1, and similar) for nicknames and puzzles. It is stylistic, not encryption.
Reverse text flips character order for palindrome experiments and mirrored-text puzzles.
Truncate cuts to a maximum length and may append an ellipsis for card previews and UI snippets. Truncation is for display; do not use it as a security measure to hide secrets.
Choosing among related tools
| Need | Prefer |
|---|---|
| Clean spacing before hashing or comparing | Collapse whitespace |
| One-line paste into a single field | Remove newlines |
| Permalink from a title | Slugify |
| Preview without tags | Strip HTML |
| Form character limit | Count characters |
| Approximate reading length | Count whitespace (words) |
| Deduplicate agent output lists | Unique lines, then optionally sort |
For longer editing sessions (case transforms, speech, placeholder copy), see the separate Texts family. For encoding (Base64, hex) use those dedicated converters rather than inventing ad-hoc text mangling.
Limitations and encoding notes
- Unicode. Character counts follow JavaScript string indexing conventions; grapheme clusters (emoji with modifiers, some accented combinations) may not match human “visible character” intuition.
- Locale. Sort order is locale-aware where implemented; results can differ across languages.
- HTML. Tag stripping is not XSS protection for embedding untrusted HTML elsewhere.
- URLs. Pattern validation ≠ reachability or trust.
- Privacy. Paste only text you are willing to process in the browser session; avoid pasting secrets into public machines.
Practical workflows
Blog title → URL. Slugify the title; if accents remain awkward, remove accents first, then slugify.
Scraped paragraph → plain note. Strip HTML, collapse whitespace, then truncate for a short summary field.
Agent ID dump → clean list. Unique lines, sort lines, then count characters if you need a size check before upload.
Nickname idea. Leetspeak or reverse text for playful variants—never as a password generator.
Related tooling
- Collapse whitespace
- Count characters
- Count whitespace
- Leetspeak
- Remove accents
- Remove newlines
- Reverse text
- Slugify
- Sort lines
- Split vowels and consonants
- Strip HTML
- Truncate
- Unique lines
- Validate URL
Summary
Text utilities are small, predictable transforms for cleanup, measurement, and light formatting. Prefer the specific subtool that matches your next step—normalize, measure, slug, or validate—rather than chaining unrelated mangling. Keep security and encoding limits in mind: these helpers shape strings; they do not authenticate, encrypt, or fully sanitize untrusted markup.