Slug Generator

Max 1 KB · Updates automatically as you type

Separator
Options

A URL slug is the human-readable segment of a web address that identifies a specific page — in example.com/blog/10-tips-for-better-sleep, the slug is 10-tips-for-better-sleep. It’s what a blog title, product name, or page heading turns into once it’s been stripped down to the small set of characters a URL can safely contain without any encoding: lowercase letters, numbers, and a single separator character between words.

Slugs matter for reasons beyond tidiness. Search engines display the URL path in search results and use the words in it as a (modest) relevance signal, so /blog/10-tips-for-better-sleep is both more informative to a searcher and more useful to a crawler than /blog/post?id=48219. Slugs are also what people actually read, remember, and paste into chat — a clean, descriptive slug is easier to trust and easier to type than an opaque database ID. Most content management systems (WordPress, Ghost, Shopify, Contentful) generate a slug automatically from a title, and this tool does the same transformation on demand for any text — a title you’re drafting before it exists in a CMS, a heading you’re renaming, or a string you’re preparing for a system that doesn’t slugify for you.

The transformation itself has a few concrete steps. Text is lowercased (optional — toggle it off if you need to preserve case for a system that’s case-sensitive by convention), accented letters are transliterated to their plain-ASCII equivalent via Unicode’s own decomposition (é → e, ü → u, ș → s), and every run of anything that isn’t a letter or number — spaces, punctuation, existing hyphens or underscores — collapses into a single separator character. Leading and trailing separators are trimmed, so a title that starts or ends with punctuation doesn’t produce a stray hyphen at either end of the slug.

The separator itself is a choice, not a fixed convention: hyphens are the default and the one search engines are documented to treat as a genuine word boundary, but underscores are offered for the systems and naming schemes that prefer them. Both options are exposed as native radio buttons and checkboxes, so the result updates live as you type or toggle a setting — there’s no separate “Generate” step.

Everything runs locally in your browser using plain JavaScript string and Unicode operations; nothing is sent to a server. If the slug you generate here needs to be embedded as a value inside a query string alongside characters a URL can’t contain literally, the URL Encode/Decode tool handles that separate step.

Examples

Frequently asked questions

What exactly is a URL slug?
The part of a URL that identifies a specific page in readable form, usually the last segment of the path — in example.com/blog/my-post-title, my-post-title is the slug. It's what's left after a title or heading is stripped down to lowercase letters, numbers, and a single separator character, with everything else (spaces, punctuation, accents) removed or converted.
Why use hyphens instead of underscores?
Google has said for years that it treats a hyphen as a word separator but an underscore as a joining character — my-post-title is read as three words, my_post_title risks being read as one token. Hyphens are the conventional default for this reason and are what most CMS platforms (WordPress, Ghost, Shopify) generate automatically. Underscores are offered here for cases with their own convention — some static site generators, file-naming schemes, or internal systems prefer them.
What happens to accented letters like é or ș?
They're transliterated to their closest plain-ASCII letter — é becomes e, ü becomes u, ș becomes s — using Unicode's own decomposition (splitting a letter into a base letter plus an accent mark, then dropping the accent mark), not a hand-maintained lookup table. This covers accented Latin script reliably. Scripts with no such decomposition, like Chinese, Japanese, Korean, or Arabic, have no plain-ASCII equivalent to fall back to, so those characters are dropped rather than substituted.
What if my text reduces to nothing — like a title that's all emoji or symbols?
You'll see a message saying the input reduces to an empty slug instead of a blank or misleading result. This happens when every character in the input is stripped (no letters or numbers survive) — a title that's just punctuation, emoji, or an unsupported script are the common causes.
Is my text sent to a server?
No. The slug is generated entirely in your browser with plain JavaScript string operations. No data leaves your device, and nothing is logged.