Slug Generator
Convert any string into a clean URL-safe slug
How to Slug Generator Online
Convert any string — a title, headline, or filename — into a clean, URL-safe slug.
- Type or paste the source text into the input box (article title, product name, anything that needs to live in a URL).
- Pick a separator: hyphens are the SEO-friendly default; underscores work for filenames; periods are unusual but occasionally needed.
- Decide whether to lowercase — keep this on for URLs (case-sensitive servers will treat `/Hello` and `/hello` as different pages); turn it off when generating filenames where casing matters.
- Optionally enable "Strip stop words" for category-style URLs where dropping "the", "a", "and" makes the slug crisper.
- Set a max length if your CMS or routing system imposes one (50–60 characters is the typical SEO sweet spot).
- Copy the result and paste it into your CMS, frontmatter, or routing config.
About Slug Generator
A URL slug is the human-readable identifier in a URL — the `introduction-to-typescript` portion of `example.com/blog/introduction-to-typescript`. Slugs serve three audiences at once. Search engines use them as a structural hint about page content. Humans use them when deciding whether to click a shared link or trust a URL pasted into a chat. And maintainers use them as stable references that survive title edits. A good slug is short, lowercase, ASCII-only, and unambiguous; a bad slug is a randomly-generated UUID or the literal article title with spaces left in.
The hard part of slug generation is what to do with characters that are not ASCII. A naïve "lowercase + replace non-alphanumeric with hyphen" approach loses every accent, every non-Latin character, and most punctuation that carries meaning (`&`, `@`). The slugifier here does the standard three-step dance used by libraries like `slugify`, `@sindresorhus/slugify`, and Django's `slugify` utility: first Unicode NFKD-normalize the string, which splits accented letters into a base letter plus a combining mark; second, drop the combining marks (turning `é` into `e`, `ñ` into `n`); third, apply hand-coded transliterations for letters that do not decompose to ASCII (`ß → ss`, `æ → ae`, `ø → o`, `ł → l`, `þ → th`). Symbols with semantic meaning get spelled out: `&` becomes `and`, `@` becomes `at`.
Three options matter in practice. **Separator** — hyphens are the convention for URLs because search engines read them as word boundaries, while underscores are not. Filenames sometimes prefer underscores for shell-friendliness. **Stop-word stripping** is useful for category and tag slugs ("the-best-cameras" reads better as "best-cameras") but should usually stay off for article slugs where the full title needs to be recognizable. **Max length** keeps long titles from producing 200-character slugs that get truncated in search result snippets and social previews; 50–60 characters is the consensus sweet spot. When the length cap kicks in, the trimmer breaks on a word boundary rather than mid-word, so you do not end up with `introduction-to-typesc`.
Non-Latin scripts (Chinese, Arabic, Cyrillic, Devanagari) are stripped rather than transliterated. Romanization is a genuinely hard linguistics problem with multiple competing standards per language — pinyin vs. Wade-Giles for Chinese, ISO 233 vs. BGN/PCGN for Arabic — and getting it wrong silently produces wrong slugs. For multilingual sites the modern practice is to keep the source script and rely on percent-encoded UTF-8 URLs (`/blog/你好世界`), which browsers handle correctly and which read more naturally to native speakers than any transliteration.
The whole slugifier is a pure function under 2 KB. It runs synchronously in your browser as you type, makes no network requests, and has no dependencies. Verify in DevTools: typing in the input box produces zero network activity.
Related Tools
Frequently Asked Questions
What exactly is a URL slug?
A slug is the human-readable part of a URL that identifies a specific resource — the `how-to-bake-bread` portion of `example.com/blog/how-to-bake-bread`. Search engines and humans both use slugs as a quick summary of what the page is about, which is why getting them right matters.
Why is "café" turned into "cafe" instead of being kept?
URLs are technically allowed to contain non-ASCII characters under RFC 3987 (IRIs), but browsers and servers will percent-encode them on the wire (`café` becomes `caf%C3%A9`). That is ugly in shares and analytics, sometimes truncated by mail clients, and not consistently rendered. The standard practice is to strip combining marks via Unicode NFKD normalization, which converts `é` to `e` + combining acute and then drops the accent.
How are characters like ß, æ, and ø handled?
Those letters do not decompose to ASCII under NFKD because they are not single accented letters — they are letters in their own right. The slugifier has explicit rules: `ß → ss`, `æ → ae`, `ø → o`, `ł → l`, `þ → th`. These mirror standard transliteration conventions used by libraries like `unidecode` and `slugify` across most languages.
Should I strip stop words for SEO?
Often yes for category and tag slugs (`/the-best-cameras` reads better as `/best-cameras`), but rarely for article slugs where the title should still be recognizable. Google has stated repeatedly that exact-match slug keywords are a minor ranking factor; readability and stability matter more. The stop-word stripper here removes 20 common English words; toggle it on or off depending on the URL's role.
What is the right maximum length?
Roughly 50–60 characters is the sweet spot. Google's search results display up to about 70 characters of URL before truncating. WordPress defaults to no limit but recommends 75. Long slugs are not actively harmful for SEO, but they truncate in social-share previews and are harder to read in browser status bars. The trimmer here breaks on word boundaries so you never end up with a half-word slug.
Are non-Latin scripts (Chinese, Arabic, Cyrillic) supported?
They are stripped, because mapping them to Latin requires language-specific transliteration tables (pinyin for Chinese, romanization for Arabic, ALA-LC for Cyrillic) that have many competing conventions. For multilingual sites the modern practice is to use percent-encoded UTF-8 URLs (`/blog/你好`) rather than transliterating; this tool focuses on the Latin-script case.
Are my inputs sent to any server?
No. The slugifier runs as a small pure function in your browser (under 2 KB). Try the network tab in DevTools — typing into the input field generates zero network requests.