About Text to Slug
A slug is the clean, readable part of a URL — the my-first-post in example.com/blog/my-first-post. This turns a title or heading into one: lowercase, spaces and punctuation replaced by hyphens, accents flattened, so the result is safe to drop into a web address. Bloggers, developers and CMS users reach for it when setting page URLs, permalinks, file names, IDs or anchor links, where a tidy slug is better for readability and SEO than an auto-generated string of numbers.
How it works
The text goes through a few steps:
- Unicode normalisation (NFKD) splits accented letters into a base letter plus a combining mark, and the combining marks are stripped — so
cafébecomescafeandnaïvebecomesnaive. - Optionally lowercase the text (on by default for conventional slugs).
- Every run of characters that isn't a letter or digit is replaced by your chosen separator (a hyphen by default, or an underscore).
- Leading/trailing separators are trimmed and any repeats are collapsed to one.
The result updates live as you type.
Assumptions and defaults
- Separator defaults to a hyphen (
-), the web convention for slugs; underscore is available as an alternative. - Lowercasing is on by default, since slugs are conventionally lowercase.
- Accented Latin letters are transliterated by stripping their accents (é→e), so common European text produces sensible ASCII slugs.
- Only
a–z,A–Zand0–9survive as slug characters; everything else becomes a separator.
Limitations
- Non-Latin scripts don't transliterate. Because it works by stripping accents from Latin letters, characters with no Latin base — Cyrillic, Greek, Arabic, Chinese, Japanese, Korean, emoji — have nothing to reduce to and are dropped. A title written entirely in such a script can produce an empty or hyphen-only slug.
- It doesn't romanise or translate — it won't turn
Москваintomoskvaor東京intotokyo. - It doesn't remove stop words ("the", "a") or shorten long titles; the whole title becomes the slug.
- Some accented characters that don't decompose under NFKD (like ß or ø) may be dropped rather than converted.
Privacy
Slug generation runs entirely in your browser. Your text is never uploaded or stored.

