complete.tools

URL Slug Generator

Turn a title or phrase into a clean lower case URL slug made of letters, digits and hyphens or underscores.

What this tool does

Turn a title or phrase into a clean lower case URL slug made of letters, digits and hyphens or underscores. You fill in these fields: Text and Separator. It shows slug and length.

Inputs

  • Text: Text, up to 300 characters. The title or phrase to turn into a slug.
  • Separator: Choose one: Hyphen (-), Underscore (_). Starts as Hyphen (-). Placed between words.

How to use

  1. Type the text.
  2. Choose Hyphen (-) or Underscore (_) for "Separator".
  3. Read the result: slug and length. It appears once every required field has a valid value.

Worked examples

Example 1. Inputs:

  • Text: "10 Tips for React Development!"
  • Separator: Hyphen (-)

Results:

  • Slug: 10-tips-for-react-development
  • Length: 29 (characters)

How this is worked out: Lower case: '10 tips for react development!'. The '!' and every space are outside a to z and 0 to 9, so each run becomes one hyphen: 10-tips-for-react-development. Length: 2 + 1 + 4 + 1 + 3 + 1 + 5 + 1 + 11 = 29.

Example 2. Inputs:

  • Text: "Straße Ærø 2024"
  • Separator: Hyphen (-)

Results:

  • Slug: strasse-aero-2024
  • Length: 17 (characters)

How this is worked out: Letters with no accent form are spelled out: ß is ss, Æ is ae, ø is o. Result strasse-aero-2024. Length: 7 + 1 + 4 + 1 + 4 = 17.

Example 3. Inputs:

  • Text: "Tom & Jerry’s 2nd Show"
  • Separator: Underscore (_)

Results:

  • Slug: tom_jerrys_2nd_show
  • Length: 19 (characters)

How this is worked out: Lower case: tom & jerry’s 2nd show. The curly apostrophe is dropped (jerrys). The run ' & ' between tom and jerrys is one underscore, and each other space is one underscore: tom_jerrys_2nd_show. Length: 3 + 1 + 6 + 1 + 3 + 1 + 4 = 19.

Example 4. Inputs:

  • Text: "Tokyo東京Guide"
  • Separator: Hyphen (-)

Results:

  • Slug: tokyo-guide
  • Length: 11 (characters)

How this is worked out: Lower case: tokyo東京guide. The two Japanese characters have no a to z form, so that run becomes one hyphen between the words on either side: tokyo-guide. Length: 5 + 1 + 5 = 11.

Limitations

  • It does not translate other scripts into Latin letters, so text written only in them gives no slug.
  • Accents are removed, not spelled out, so the German ä, ö and ü become a, o and u and not ae, oe and ue.
  • Only ß, æ, œ, ø, đ, ð, þ, ł and the dotless ı are spelled out. Any other letter that is not a plain letter with an accent, such as ħ or ŋ, is treated like a space.
  • Symbols such as & and % are left out and not written as words such as and or percent.
  • It does not shorten the slug or remove small words such as the and of.
  • It does not check whether the slug is already used on your site.

FAQs

Q: What does a slug contain?
A: Only lower case letters a to z, digits 0 to 9, and your chosen separator. Every run of anything else becomes a single separator, and none is left at either end.
Q: What happens to accented letters?
A: They fold to the plain letter, so café becomes cafe. The letters ß, Æ and ø are written as ss, ae and o.
Q: What about apostrophes?
A: They are dropped, so Brulee's becomes brulees instead of brulee-s.
Q: What if my text is in Chinese, Arabic or another script?
A: Characters with no plain a to z form are treated like spaces, so they are left out and a separator takes their place between words. If nothing is left, the tool says so instead of giving an empty slug.

Explore Similar Tools

Explore more tools like this one: