URL Slug Generator

Convert text into clean, SEO-friendly URL slugs

About This Tool

Paste a title or sentence and the generator returns a URL-safe slug: lowercased, accented characters folded to ASCII, spaces replaced with hyphens, special characters stripped or replaced. The result drops cleanly into a route segment without escaping.

A few choices the generator makes: stop words (the, a, of, and) are kept by default because removing them can change meaning — 'history-of-rome' is more readable than 'history-rome.' Toggle the strip-stopwords option if you want shorter slugs at the cost of clarity. Numbers and dates are preserved as-is.

Slugs are forever once published. Changing a slug means setting up a 301 redirect from the old URL or breaking every external link to that page. Pick a slug you can live with at publish time and don't iterate on it.

The transformation steps in order: lowercase the input. Decompose accented characters using Unicode NFD normalization, then strip combining marks (é = e + combining-acute → keep e, drop the accent). Strip remaining non-ASCII characters or replace with phonetic equivalents where defined. Replace whitespace with hyphens. Strip non-alphanumeric, non-hyphen characters. Collapse runs of multiple hyphens to single. Trim leading and trailing hyphens. The result is a string that's safe in any URL path segment without percent-encoding.

Worked example: input 'How AI Agents Work in 2024 — A Practical Guide!' becomes 'how-ai-agents-work-in-2024-a-practical-guide.' That's 47 characters, fine for SEO. The em-dash collapsed to a hyphen, the exclamation stripped, capital letters lowered, but the year stayed. With strip-stopwords on it shrinks to 'ai-agents-work-2024-practical-guide' (35 chars) — slightly better for length but the meaning shifts subtly (lost 'how'). For non-Latin input like 'Café au Lait Recipe,' the diacritic decomposes: 'cafe-au-lait-recipe.' For Cyrillic or CJK content the strip-step removes everything; you'd need a transliteration library (cyrillic-to-translit-js, pinyin) to get meaningful Latin slugs from non-Latin source.

Mistakes that cost you traffic: changing a slug after publication. The fix is a 301 redirect from old to new in your routing config, but every shared link that didn't get redirected still 404s for its lifetime. Including dates in slugs that you'll regret ('5-tips-for-2023'). Including version numbers ('react-hooks-v17-tutorial' becomes obsolete when v18 ships). Including the full sentence ('the-complete-thorough-step-by-step-guide-to') creates an absurd URL that doesn't share well. Aim for the shortest slug that's still meaningful, not the most descriptive.

A slug-design rule that holds across CMS platforms: shorter slugs share better. Twitter/X shows 30-40 characters of URL after the domain in tweets; longer slugs truncate ugly. Email clients sometimes break long URLs on character boundaries, creating dead links. Aim for the shortest meaningful slug. 'react-server-components' beats 'a-deep-introduction-to-react-server-components-and-when-to-use-them' even though the second is more descriptive.

The about text and FAQ on this page were drafted with AI assistance and reviewed by a member of the Coherence Daddy team before publishing. See our Content Policy for editorial standards.

Frequently Asked Questions