Slug Generator
Turn any title into a clean, SEO-friendly URL slug with custom separator and length.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this slug generator
- Enter the title or phrase you want to convert in the "Title or phrase" field.
- Choose a separator: hyphen (-) or underscore (_) from the Separator dropdown.
- Select a case option: "lowercase" converts all letters, "keep case" leaves them as typed.
- Set the Max length (10–200 characters; default is 80) to cap the output.
- Click Generate to produce the slug, then click Copy slug to copy it to your clipboard.
About this slug generator
A slug generator converts a human-readable title or phrase into a compact, URL-safe string — the portion of a web address that identifies a specific page, such as `/blog/how-to-bake-sourdough`. Well-formed slugs help search engines parse page topics accurately, keep links legible in emails and social posts, and prevent encoding issues caused by spaces or special characters in URLs.
This tool processes your input in four distinct steps. First, it applies NFKD Unicode normalisation, which decomposes accented characters into a base letter plus a combining diacritic mark — for example, `é` is split into the letter `e` and a separate accent character. It then strips every combining mark, mapping most Latin-script accents to plain ASCII. Next, any character that is not a letter or digit is replaced with your chosen separator, consecutive separators are collapsed into one, and leading or trailing separators are removed. Finally, the string is optionally lowercased and hard-truncated to your chosen max-length, with any orphaned trailing separator cleaned up after the cut. The hyphen separator is the default because Google's documentation explicitly states that hyphens act as word boundaries in URL paths, whereas underscores do not.
Worked example: typing `How to Make Crème Brûlée — 5 Tips!` with separator set to `-`, case set to `lowercase`, and max length left at the default `80` produces `how-to-make-creme-brulee-5-tips` — 31 characters, clean and ready to paste into a CMS or route config. The entire process runs in your browser, so no text is transmitted to a server.
FAQ
- What does a slug generator do?
- A slug generator takes a human-readable title and converts it into a URL-safe string by removing accents, replacing spaces and punctuation with a separator character, and optionally lowercasing the result. The output is ready to drop into a CMS, router, or file name.
- Why does this tool use hyphens by default instead of underscores?
- Google treats hyphens as word separators in URL paths, meaning `creme-brulee` is read as two distinct words. Underscores are not treated as word separators, so `creme_brulee` is read as one token. Hyphens are the recommended choice for SEO in URL paths.
- Why should slugs be lowercased?
- Web servers and browsers treat URLs as case-sensitive by default. `/Blog/Post` and `/blog/post` can resolve to different pages, causing duplicate-content issues. Keeping slugs fully lowercase removes that ambiguity and is the standard practice for public URLs.
- How does the tool handle accented or non-ASCII characters?
- The tool applies NFKD normalisation, which splits accented characters into a base letter and a combining accent mark, then strips all combining marks. This maps most Latin-script accents — é, ü, ñ, ç — to their plain ASCII equivalents. Characters that have no ASCII base equivalent (such as most CJK ideographs or Cyrillic letters) are stripped entirely. For titles in those scripts, run a transliteration step first before using this tool.
- What max length should I use?
- Most SEO guidance recommends keeping slugs between 50 and 80 characters. Shorter slugs are easier to share and less likely to be truncated in search-result URLs. The default of 80 is a safe ceiling; 50–60 is often better for top-level pages.
- Does the slug generator store or transmit my input?
- No. The slug generator runs entirely in your browser. Your text is never sent to a server, logged, or retained after you close the page. This means you can safely generate slugs for unpublished or confidential titles.