Slug Generator
Max 1 KB · Updates automatically as you type
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
- A blog post title — "10 Tips for Better Sleep (Backed by Science)!" becomes 10-tips-for-better-sleep-backed-by-science, ready to drop straight into a permalink field.
- A title with diacritics — "Café Menu: Crème Brûlée & Piña Colada" becomes cafe-menu-creme-brulee-pina-colada, with every accented letter transliterated to its plain-ASCII equivalent rather than dropped or percent-encoded.
- Preparing a slug to embed in a query string — after generating a slug here, run it through the URL Encode/Decode tool if you need to place it inside a query parameter value alongside characters a URL can't contain literally; a slug's own hyphens and lowercase letters already need no further encoding on their own.
Frequently asked questions
What exactly is a URL slug?
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?
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.