Skip to main content
Back to Dev generators

Dev

URL Slug Generator (Developer)

Spaces, punctuation, and accented characters in a URL either get percent-encoded into ugly strings or cause routing failures if your framework is strict. The right fix is slugging the title before it becomes a URL — lowercased, stripped of special characters, and with words joined by a separator. This tool does that transformation and shows you the result immediately. Paste any title or phrase into the text field. The separator option picks between a hyphen (the web URL convention) and an underscore (common in code and file naming). The generator lowercases the input, strips combining accents via Unicode normalisation, removes non-alphanumeric characters, collapses consecutive separators into one, and trims trailing separators. If the result is empty, it returns "untitled". Copy the slug into your CMS, router, or file system. Prefer hyphens for public-facing URLs — search engines treat them as word separators. Prefer underscores for internal filenames and code identifiers where hyphen-as-minus is ambiguous.

Read the complete guide — 4 min read

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  1. Type or paste your title or phrase.
  2. Choose a hyphen or underscore separator.
  3. Click Generate to produce the slug.
  4. Copy it into your CMS or router.

Use Cases

  • Creating a slug for a blog post URL
  • Generating clean product page routes
  • Building readable documentation links
  • Naming files and routes consistently
  • Cleaning up titles for web addresses

Tips

  • Prefer hyphens for public web URLs.
  • Keep slugs short and meaningful.
  • Avoid changing slugs once a page is live.
  • Use underscores mainly in code or files.

FAQ

what is a URL slug

A slug is the readable part of a URL that identifies a page, usually derived from its title — like "my-first-post" in a blog address. Good slugs are lowercase, use hyphens between words, and contain no spaces or special characters.

how are accents and special characters handled

The tool normalises the text to Unicode NFKD form and removes combining accent characters, so é becomes e and ñ becomes n. It then strips anything that is not a letter, digit, or the chosen separator, and collapses consecutive separators into one.

should I use hyphens or underscores

Hyphens are the convention for public web URLs because search engines treat them as word separators, which helps readability and indexing. Underscores are common in code and filenames. For a blog or product URL, hyphens are usually the safer choice.

You might also like

Popular tools from other categories that share themes with this one.

Try these next

More free tools from other corners of the catalog, picked by shared themes.