Skip to content
DoItJag

Text to Slug

Create a clean, readable URL slug from a page title or any text.

About Text to Slug

Text to Slug turns a title or phrase into the short, readable part of a web address that identifies a page, such as easy-bread-recipes. It lowercases the text, converts accented letters to plain ones, replaces spaces and punctuation with a single separator, and trims separators from both ends. The slug updates as you type, so there is no button to press.

Bloggers, shop owners and developers use it when they publish a new post, product or category and want an address that is tidy, predictable and safe to share.

When to use it

  • You are publishing a blog post and your platform asks for a URL slug.
  • Product names contain accents, ampersands or brackets that do not belong in a web address.
  • You need file or folder names with underscores rather than spaces.
  • Your system limits slugs to a certain length.

Worked example

Type Crème Brûlée & Café Recipes: 10 Easy Ideas (2024).

With the Hyphen separator and no length limit, the slug is creme-brulee-and-cafe-recipes-10-easy-ideas-2024. The accents are gone, & became and, and the colon and brackets disappeared. With Underscore you get creme_brulee_and_cafe_recipes_10_easy_ideas_2024.

Set the maximum length to 30 and the slug becomes creme-brulee-and-cafe-recipes, cut at the last hyphen so no word is split. At 20 it becomes creme-brulee-and.

Good to know

  • A few letters are spelled out rather than dropped: ß becomes ss, æ becomes ae and ø becomes o, so Straße über Ærø gives strasse-uber-aero.
  • Apostrophes are treated like any other punctuation, so Don't Panic becomes don-t-panic. Remove the apostrophe first if you prefer dont-panic.
  • Letters from non-Latin scripts are kept, not transliterated: 東京 travel guide gives 東京-travel-guide.
  • The length limit backs off to the previous separator only if that keeps more than 60% of the limit. A single very long word is cut mid-word instead.
  • Slugs are always lowercase here.
  • If you need to put text with spaces or symbols in a URL unchanged, use URL Encode and Decode instead.

How to use Text to Slug

  1. Type or paste the title.
  2. Choose the separator and an optional maximum length.
  3. Copy the slug.

Privacy: how it works

Everything happens in your browser. Your text is not sent to any server.

Frequently asked questions

What happens to accented letters?

They are converted to plain letters (é becomes e, ß becomes ss). Letters from other scripts, such as Japanese, are kept.

Does a length limit cut words in half?

Usually not. The slug is cut at the last separator before the limit, unless that would remove more than 40% of the allowed length; only then is the last word cut.