TTKTheTextKit
On-Page SEO7 min read

URL Slug Best Practices: 8 Rules, Examples and a Free Generator

URL slug best practices: hyphens, lowercase, accents, non-Latin titles, length and changing a live slug, with Google's guidance and our test results.

By TheTextKit TeamPublished

URL slug best practices: a web address whose last part is the slug, with notes for lowercase, hyphens and readable words

A web address on a card, https://example.com/blog/url-slug-best-practices, with the slug at the end highlighted. Three notes below it say lowercase, hyphens between words, and readable words.

URL slug best practices come down to eight rules. Use readable words in lowercase, separated by hyphens. Keep to the letters a to z and the digits 0 to 9, and spell out accents. Keep the slug shorter than the title and leave out things that go stale. If you ever change a slug, redirect the old address. Several of these come straight from Google's URL guidance. The others come from testing slug generators, including our own. This guide gives each rule with a reason and shows the mistakes we found.

What a URL slug is and where it sits

The slug is the part of a web address that names a single page. In https://example.com/blog/url-slug-best-practices, the slug is url-slug-best-practices. The rest is the domain and a folder. Most content systems build a slug from the page title, and you can usually edit it. Our guide to the parts of a URL shows where the slug sits in the path.

URL slug best practices: 8 rules

  1. Use readable words, not IDs. Google's URL structure guide says to use readable words rather than long ID numbers. A slug like how-to-test-robots-txt tells a person what they will find. p=48213 doesn't.
  2. Use lowercase. The same guide says Google treats /APPLE and /apple as different URLs. If you mix cases, you can end up with two addresses for one page.
  3. Separate words with hyphens. Google says to use hyphens instead of underscores to separate words. So write snake-case, not snake_case.
  4. Stick to a to z and 0 to 9. Letters, digits and hyphens are safe everywhere. Spell out accents and special letters instead of deleting them: cafe, strasse.
  5. Percent-encode anything else. If you keep non-ASCII characters, Google says they should be percent encoded. RFC 3986 defines the safe characters as letters, digits, hyphen, period, underscore and tilde, and says text should first be turned into UTF-8 bytes. The next sections show what that costs.
  6. Make it shorter than the title. The slug names the topic, and the title can be a full sentence. We checked our own posts: all 39 slugs are shorter than the slug the title would give, and they average 24 characters against 58.
  7. Leave out what will go stale. A year or a count in the slug, such as best-tools-2026 or top-10-tips, becomes wrong when you update the page. This is our advice, not a rule from Google.
  8. Don't change it without a redirect. A new slug is a new address. Send the old one to the new one with a permanent redirect.
Eight URL slug rules: readable words, lowercase, hyphens, a to z and 0 to 9, percent-encode, short, nothing stale, redirect

Eight short cards: 1 readable words, 2 lowercase, 3 hyphens, 4 a to z and 0 to 9, 5 percent-encode other letters, 6 shorter than the title, 7 nothing that goes stale, 8 redirect if you change it.

The eight rules on one page.

What a basic slug generator gets wrong

Rule 4 sounds simple, and it is where many generators fail. The usual approach is to lowercase the text, strip accents and delete anything that isn't a letter or digit. That loses information. This is what the old version of our own generator produced, next to what it produces now:

TitleOld outputNow
Straße in Münchenstrae-in-munchenstrasse-in-munchen
København Guidekbenhavn-guidekobenhavn-guide
snake_case_titlesnakecasetitlesnake-case-title
Top 3.5 Tipstop-35-tipstop-3-5-tips
Q&A: Your Questionsqa-your-questionsq-and-a-your-questions
Slug generator mistakes: Straße became strae, København became kbenhavn, snake_case glued together, 3.5 became 35

A table of five titles with the old generator's output and the fixed output. Straße in München gave strae-in-munchen and now gives strasse-in-munchen. snake_case_title gave snakecasetitle and now gives snake-case-title. Top 3.5 Tips gave top-35-tips and now gives top-3-5-tips.

Deleting characters changes the meaning of a slug.

Letters that don't split into a base letter and an accent, such as ß, ø, ł and æ, were deleted outright. We tested all 398 Latin letters between U+00C0 and U+024F, and the old version turned 154 of them into nothing. Dots and underscores were deleted too, so 3.5 became 35 and two words were glued into one.

The current generator spells the special letters out, turns & into and, drops apostrophes without splitting the word, and treats every other symbol as a word break. We checked it on 20,000 random strings: the result always had only a to z, 0 to 9 and single hyphens, and slugging a slug changed nothing.

What about titles in other alphabets?

A title in Russian, Greek, Japanese or Arabic has no letters from a to z. A plain generator returns an empty slug, which is why ours now says so and offers an option to keep the letters. If you keep them, remember Google's rule that non-ASCII characters should be percent encoded. In a link each letter becomes several characters:

SlugCharactersIn a link
привет-мир1055
γειά-σου-κόσμε1474
日本語のタイトル872
café49
Percent-encoding lengthens non-Latin slugs: a 10-character Russian slug becomes 55 characters, a Japanese one of 8 becomes 72

A table of four slugs and their length after percent-encoding. A Russian slug of 10 characters becomes 55. A Greek slug of 14 becomes 74. A Japanese slug of 8 becomes 72. The word cafe with an accent, 4 characters, becomes 9.

Each non-Latin letter costs 5 to 9 characters in a link.

A Russian letter takes two bytes, so it becomes six characters such as %D0%BF. A Japanese character takes three bytes and becomes nine. Browsers usually show the readable form in the address bar, but a copied link or a plain-text email shows the long one. Which is better depends on your readers. If they read and type in that alphabet, a slug in it is more useful to them. If your site is mostly read by people who use the Latin alphabet, a transliterated slug is easier to share.

How long a URL slug should be

Google's guidance asks for simple URLs that people can understand, but the part we read sets no length. So look at what works for you. Here is our own blog. The 39 slugs range from 2 to 9 words and from 12 to 40 characters, with a median of 4 words:

Our 39 blog slugs average 24 characters, while slugs made from the full titles would average 58

Two bars compare lengths. The 39 slugs we use average 24 characters. If each slug were made from the full title it would average 58 characters.

We use the keyword as the slug, not the whole title.

We write the title for readers and the slug for the topic. The title How to Convert Text to Binary: ASCII, UTF-8 and Emoji Explained would make a 61-character slug, so we use convert-text-to-binary. A useful test: if you can say what the page is about from the slug alone, stop adding words.

Good and bad slugs side by side

Here are five common problems with the slug each one produces, and a better version for a page about testing robots.txt files:

ProblemBad slugBetter slug
An ID instead of wordsindex.php?p=48213how-to-test-robots-txt
Capitals, underscore and symbolHow_To_Test_Robots.txt!how-to-test-robots-txt
The whole titlehow-to-test-robots-txt-with-a-free-tester-and-check-blocked-urls-fasthow-to-test-robots-txt
A year that will agehow-to-test-robots-txt-2026how-to-test-robots-txt
Words run togetherhowtotestrobotstxthow-to-test-robots-txt

The better slug is the same every time, because it names the topic and nothing else. Applying these URL slug best practices also gives you an address that stays valid for as long as the page does.

How to create a good slug in four steps

  1. Start from the topic, not the title. Write down the main phrase a reader would search for.
  2. Paste it into the URL Slug Generator. It lowercases, removes accents, joins words with hyphens and shows the result.
  3. Shorten it. Use the max_length option to cut at a hyphen, or delete filler words yourself.
  4. Check it. Read it aloud, and make sure it has no dates or numbers that will go stale.

If you need to turn a slug that already exists into another style, the Case Converter converts between kebab-case, snake_case and other forms. To see exactly how a link will be percent-encoded, paste it into the URL Encoder and Decoder.

How to change a URL slug safely

Sometimes a slug has to change. Do it in this order:

  1. Change the slug in your content system.
  2. Add a permanent redirect from the old URL to the new one. Our guide to the 301 vs 302 redirect explains which code to use and why a 301 is cached.
  3. Update your internal links so they point at the new address and don't depend on the redirect.
  4. Update your sitemap so it lists only the new address. Our guide on how to create an XML sitemap covers what to include.

Frequently asked questions

What is a URL slug?

The slug is the part of a web address that names one page, usually the last part. In https://example.com/blog/url-slug-best-practices the slug is url-slug-best-practices. It is often made from the page title.

Should a URL slug use hyphens or underscores?

Hyphens. Google's URL guidance says to use hyphens instead of underscores to separate words. Our generator turns underscores in a title into hyphens, so snake_case becomes snake-case.

How long should a URL slug be?

As short as it can be while still saying what the page is about. The Google guidance we read sets no limit. Our 39 blog slugs average 24 characters and 4.6 words, against 58 characters if we used the full title.

Can a URL slug have capital letters or spaces?

It can, but it shouldn't. Google treats /APPLE and /apple as different URLs, so mixed case risks two addresses for one page. Spaces are not allowed in a URL and become %20, so use hyphens instead.

Can I change a URL slug after publishing?

Yes, but the old address stops working unless you redirect it. Add a 301 redirect from the old URL to the new one, update your internal links and sitemap, and expect it to take Google some time to follow.

Make your slug now

Paste your topic into the URL Slug Generator, choose a maximum length if you want one, and copy the result. Follow these URL slug best practices and your address will read well to people, behave well in links and survive a future redesign.

Try these free tools

100% in your browser

Keep reading

All articles →