ToolNimba Browse

🔗 URL Slug Generator

By ToolNimba Editorial Team · Updated 2026-06-19

Type some text to generate a slug.

This URL slug generator turns any title or phrase into a clean, web-safe slug. Paste your text and it instantly lowercases everything, removes accents and symbols, and joins the words with hyphens (or underscores if you prefer). The result is the part of a URL that appears after the final slash, ready to copy into your CMS, blog, or static site.

What is the Slug Generator?

A slug is the human-readable part of a URL that identifies a specific page, usually the bit at the end of the address. For a post titled "10 Café Recipes You Will Love", a good slug is "10-cafe-recipes-you-will-love". Search engines and people both read slugs, so a clean slug that contains your main keywords is easier to understand, share, and rank than a string of numbers or query parameters.

Turning a title into a slug follows a fixed set of steps. The text is lowercased so the URL is consistent and case-insensitive on most servers. Accented characters such as é or ü are folded to their plain ASCII forms (e becomes e, u becomes u) because non-ASCII characters get percent-encoded in URLs and look messy. Spaces and underscores are replaced with a single separator, every remaining symbol that is not a letter, number, or separator is removed, runs of separators are collapsed to one, and any separator at the start or end is trimmed off.

The hyphen is the recommended separator for URLs. Google has long treated hyphens as word boundaries, so "blue-widgets" reads as two words, while underscores have historically been treated as joiners, making "blue_widgets" read as one token. Underscores are still common in file names and some frameworks, so this tool offers both, but for public web pages a hyphen is the safer default.

When to use it

  • Creating a clean permalink for a new blog post or article from its title.
  • Generating consistent slugs for product pages, categories, or landing pages in a CMS.
  • Converting messy headings with accents, emoji, or punctuation into safe URL paths.
  • Naming static files and routes in a framework that expects lowercase, hyphenated names.

How to use the Slug Generator

  1. Paste or type your title or phrase into the text box.
  2. Choose your separator: hyphen for public URLs, underscore if your system needs it.
  3. Leave "Remove accents" ticked so characters like é and ñ become plain ASCII.
  4. Read the generated slug below and click Copy to use it in your CMS or code.

Formula & method

slug = trim( collapse( remove-symbols( replace-spaces-and-underscores( fold-accents( lowercase(text) ) ) ) ) ). Spaces and underscores become the separator; non-alphanumeric characters are dropped.

Worked examples

A blog title with a number, an accent, and punctuation.

  1. Start: "10 Café Recipes You'll Love!"
  2. Lowercase and fold accents: "10 cafe recipes you'll love!"
  3. Replace spaces, drop apostrophe and "!": "10-cafe-recipes-youll-love"
  4. No double or edge hyphens to clean up

Result: 10-cafe-recipes-youll-love

A heading with underscores and extra spaces, using a hyphen separator.

  1. Start: "Hello World__Foo"
  2. Lowercase: "hello world__foo"
  3. Spaces and underscores become hyphens: "hello---world--foo"
  4. Collapse repeated hyphens: "hello-world-foo"

Result: hello-world-foo

A title with leading and trailing symbols.

  1. Start: " --Trim-- this "
  2. Lowercase and replace spaces: "---trim---this-"
  3. Collapse repeats: "-trim-this-"
  4. Trim edge hyphens: "trim-this"

Result: trim-this

Common inputs and their generated slugs (hyphen separator, accents removed)

Input textGenerated slug
My First Blog Postmy-first-blog-post
Top 10 SEO Tips (2026)top-10-seo-tips-2026
Über Cool Gadgetsuber-cool-gadgets
Price: $9.99 Only!price-999-only
email_signup_formemail-signup-form
Café & Bar Menucafe-bar-menu

Hyphen vs underscore as a URL word separator

SeparatorTreated by search engines asBest for
Hyphen ( - )Word boundary (two words)Public web pages and SEO
Underscore ( _ )Word joiner (one token)File names, some frameworks

Common mistakes to avoid

  • Using underscores in public URLs. Search engines read hyphens as spaces between words but historically read underscores as joiners. For pages you want to rank, choose the hyphen separator.
  • Leaving accents and special characters in. Characters like é, ñ, or emoji get percent-encoded in a URL, turning a clean path into something like %C3%A9. Folding to plain ASCII keeps slugs readable.
  • Making slugs needlessly long. A slug does not need every word from the title. Drop filler words like "a", "the", and "of" where it still reads clearly so the URL stays short and focused.
  • Changing a published slug without a redirect. Editing a live slug changes the URL and breaks existing links and rankings. If you must change it, set up a 301 redirect from the old slug to the new one.

Glossary

Slug
The readable identifier in a URL, usually the segment after the last slash, derived from a page title.
Permalink
The full, permanent URL of a page. The slug is the editable, word-based part of it.
Separator
The character used between words in a slug, normally a hyphen for web URLs.
ASCII folding
Converting accented or special letters to their plain English equivalents, so é becomes e and ü becomes u.
URL encoding
Replacing unsafe characters in a URL with percent codes (for example a space becomes %20), which slugs avoid by using safe characters only.

Frequently asked questions

What is a URL slug?

A URL slug is the human-readable part of a web address that identifies a page, usually the words after the final slash. For example, in /blog/url-slug-generator the slug is "url-slug-generator".

Should I use hyphens or underscores in a slug?

Use hyphens. Search engines treat hyphens as word separators, so "blue-widgets" reads as two words, while underscores are read as a single joined token. Hyphens are the standard for public URLs.

Does this slug generator send my text anywhere?

No. The whole tool runs in your browser with plain JavaScript. Your text is never uploaded, stored, or sent over the network, so it works offline and keeps drafts private.

How are accented characters handled?

With "Remove accents" enabled, letters like é, ñ, and ü are folded to their plain ASCII forms (e, n, u). This keeps the slug readable and avoids ugly percent-encoding in the URL.

How long should a slug be?

There is no hard limit, but shorter is better. Aim for a handful of meaningful words that include your main keyword. Drop filler words so the URL stays concise and easy to read or share.

Can I change a slug after publishing?

You can, but the URL changes too, which breaks existing links and can hurt rankings. If you must change a live slug, add a 301 redirect from the old URL to the new one to preserve traffic.