How to Make a Clean URL Slug From a Title

Turn a title into a clean URL slug: lowercase, hyphenated, accent-stripped and tidy. Learn what makes a good slug and why hyphens beat underscores.

Updated 5 min read By CodingEagles
Free tool URL Slug Generator Turn a title into a clean, lowercase, hyphenated URL slug. Open tool

To make a URL slug, paste your title into a slug generator and it returns a lowercase, hyphenated, accent-free version ready to drop into a link. So “My First Blog Post!” becomes my-first-blog-post. The free URL slug generator does it instantly in your browser, with no sign-up and nothing uploaded.

A slug is the readable tail of a web address, the part after the last slash that names the page. Getting it right keeps your links clean, shareable and easy for search engines to read.

What a slug is and why it matters

Compare two links to the same article:

example.com/p?id=4827
example.com/how-to-bake-sourdough

The second tells a reader what the page is before they click, survives being pasted into a chat or email without looking broken, and gives search engines plain words to work with. The slug is that human-readable part, and a good one is worth the few seconds it takes to generate.

The rules of a clean slug

A slug that behaves everywhere follows a short set of rules:

  • Lowercase only. URLs can be case-sensitive on some servers, so mixing cases risks two addresses pointing at one page. Lowercase sidesteps the problem.
  • Hyphens between words. Spaces are not allowed in URLs and get encoded into %20, which looks ugly. Hyphens keep words separate and readable.
  • Letters, numbers and hyphens only. Punctuation, slashes and symbols either break the URL or get encoded into noise. Strip them.
  • No accents. Accented letters get percent-encoded into long unreadable strings, so they are flattened to plain equivalents.
  • Short and meaningful. A slug does not need every word of the title. Keep the words that describe the page and drop filler like “the” and “a”.

Doing all of this by hand for every title is tedious and easy to get wrong. A generator applies the rules consistently.

How to make a slug

Step 1: Paste a title

Drop in a post title, heading or product name, punctuation and all, into the slug generator.

Step 2: Read the slug

It is lowercased, accents are flattened, punctuation is removed, and spaces become hyphens automatically.

Step 3: Copy it

Paste the slug into your CMS, your route configuration, or a file name. Consistent slugs across a site keep your URLs predictable.

Why hyphens, not underscores

This trips up a lot of people, so it is worth being clear. For URLs, hyphens are the convention and underscores are not. Search engines have long treated a hyphen as a word separator, so red-shoes reads as “red shoes”. An underscore, historically, was read as joining words, so red_shoes could be read as the single token “red_shoes”. Hyphens give you two clean words; underscores risk one muddled one. Underscores still belong in code identifiers like snake_case, just not in web addresses.

Beyond URLs: file and folder names

The same tidy format makes excellent file names. Lowercase, hyphenated names with no spaces or odd characters behave identically across Windows, macOS and Linux, which spares you the broken-link and “file not found” headaches that spaces and accents can cause. If you generate slugs for your files as well as your URLs, everything stays consistent.

Picking a different case style

A slug is one specific format. If you need a code identifier instead, like camelCase or snake_case for a variable, the rules differ. See how to change text case without retyping for the full set of case styles.

Frequently asked questions

What makes a good URL slug?
A good slug is lowercase, separates words with hyphens rather than spaces or underscores, contains only letters, numbers and hyphens, and is short enough to read at a glance. That keeps URLs tidy, shareable and friendly for people and search engines alike.
What happens to accents and non-English letters?
Accented letters are converted to their closest plain equivalent, so cafe creme rather than something with é and è. This keeps slugs reliable in links and file systems, where unusual characters get encoded into unreadable strings.
Why hyphens instead of underscores?
Search engines treat hyphens as word separators but tend to read underscores as joining words, so url-slug is seen as two words while url_slug can read as one. Hyphens are the long-standing convention for clean, readable web URLs.
Is my text uploaded?
No. The slug is generated on your own device. Nothing is sent to a server, and the tool keeps working offline after the page loads.

Ready to try it?

Turn a title into a clean, lowercase, hyphenated URL slug. Free, in-browser, and 100% private — your data never leaves your device.

Open the URL Slug Generator