HandyBench

Text to Slug

Turn titles into clean URL slugs.

How to use the Text to Slug

  1. 1 Paste a title or phrase.
  2. 2 The tool lowercases it, strips accents and punctuation, and joins words with hyphens (or underscores if you choose).
  3. 3 Copy the slug for your URL.

The slug pipeline, step by step

A slug is the readable last segment of a URL. This tool builds one with five fixed steps, applied in this order.

  1. Normalise (NFKD): splits accented letters into a base letter plus a combining mark, and also expands compatibility forms such as the ligature fi and full-width digits.
  2. Drop accents from Latin letters only: the accent pieces are deleted, leaving the plain letter. Marks that belong to other scripts (the breve on Cyrillic й, vowel signs in Hindi) are kept, so those words are not corrupted.
  3. Lowercase, and transliterate a few Latin letters that have no accent form: ß becomes ss, æ becomes ae, œ becomes oe, ø becomes o, đ and ð become d, þ becomes th and ł becomes l.
  4. Remove everything except letters and digits from any script, whitespace, hyphens and underscores. Dashes such as the en and em dash count as word breaks.
  5. Split on every run of whitespace, hyphens and underscores, then join the pieces with one separator: a hyphen by default, or an underscore if you choose it. Nothing is left at the start or end.

Worked examples

InputHyphen slug
10 Best Coffee Shops in Toronto!10-best-coffee-shops-in-toronto
Crème Brûlée: Café-Style Dessertscreme-brulee-cafe-style-desserts
Tom & Jerry — snake_casetom-jerry-snake-case
Straße Ørstedstrasse-orsted
- Hello -hello
Привет мирпривет-мир
C++ vs C#c-vs-c

Punctuation other than dashes is deleted, not converted to words, so an ampersand vanishes and C++ and C# both become c. Underscores in the input become separators, which is why snake_case became snake-case. Titles in Cyrillic, Greek, Chinese, Japanese, Korean or Arabic keep their letters instead of producing an empty slug. Such slugs are valid URLs, but they are percent-encoded when copied (for example %D0%BF...), so choose an English slug if the link will often be pasted into plain text.

Why slugs matter in a URL

A slug that mirrors the page title gives visitors and crawlers a quick hint of the content, and it avoids characters that must be percent-encoded when they appear in a link. Spaces, ampersands and accented letters all turn into sequences such as %20 or %C3%A9 if left in a path, which makes shared links ugly and hard to read aloud.

Hyphen or underscore?

Google's guidance on URL structure recommends hyphens as word separators, because it reads coffee-shops as two words, while underscores can be treated as joining them. Underscores remain common in file names and some frameworks. For web pages, keep the hyphen default.

Edge cases

  • Leading and trailing dashes, spaces and underscores never reach the slug: - Hello - gives hello. A title with no letters or digits at all, such as !!!, gives an empty slug.
  • Two different titles can end up with the same slug, as C++ and C# show, so check uniqueness on your own site.
  • There is no length limit and no stop-word removal. For shorter, keyword-focused slugs, which use this same conversion after dropping stop words, use the SEO slug generator, and use the case converter for kebab-case in code identifiers, where accented letters are handled differently.

Examples

  • ▸ "10 Best Coffee Shops in Toronto!" → 10-best-coffee-shops-in-toronto
  • ▸ "Crème Brûlée: Café-Style Desserts" → creme-brulee-cafe-style-desserts

Frequently asked questions

Why use a slug instead of the raw title in a URL?

Slugs are lowercase, hyphenated and free of special characters, making URLs readable, shareable and friendlier for search engines.

How does it handle accents and special characters?

Accented Latin letters are converted to their plain equivalent (é → e) and punctuation and symbols are removed, leaving only lowercase letters, numbers and your chosen separator. Punctuation is deleted rather than spelled out, so "Tom & Jerry" becomes tom-jerry.

What happens to non-English letters like ß, ø or Chinese characters?

Common Latin letters without an accent form are transliterated: ß becomes ss, ø becomes o, æ becomes ae, đ becomes d and ł becomes l, so Straße Ørsted becomes strasse-orsted. Letters from other scripts such as Cyrillic, Greek, Chinese, Japanese, Korean and Arabic are kept (lowercased) rather than deleted, so a non-Latin title still gives a usable slug. Browsers and Google handle these URLs, but the address is sent percent-encoded when shared, so use an English slug if you want the link to stay short and readable everywhere.

Should I use hyphens or underscores in a URL slug?

Use hyphens for web pages. Google recommends hyphens as word separators, while underscores may be read as joining words together. The underscore option is there for file names and systems that require it.

What happens to underscores, extra hyphens and leading dashes?

They do not disappear any more: underscores, spaces, hyphens and dashes in the input all count as word separators and become your chosen separator, so snake_case becomes snake-case (or snake_case with the underscore option). Runs of separators collapse into one, and no separator is left at the start or end.

What is the difference between this and the URL slug generator?

This tool is a quick text-to-slug converter. The SEO slug generator uses the same conversion and adds stop-word removal for more keyword-focused slugs.