Slug Generator

Processed locally

Convert any text to clean URL slugs — lowercase, hyphenated, accent-stripped, URL-safe. Also generates snake_case, camelCase, and PascalCase variants.

Separator:
Runs entirely in your browser — nothing is uploaded
Runs entirely in your browser. No uploads. Your files stay private.

What Is a Slug?

A slug is the URL-friendly version of a string — typically lowercase, with whitespace replaced by hyphens and characters outside a safe ASCII range removed. The term comes from the newspaper industry, where a short label identified an article in production; the web borrowed it for the path segment that names a page, e.g. the my-first-post in /blog/my-first-post.
This generator runs the input through three string operations native to JavaScript. First, String.prototype.normalize("NFD") performs Unicode Normalization Form Canonical Decomposition, which splits an accented character like é into the base letter e plus a combining acute accent (U+0301). A regex then strips the combining-mark range U+0300 to U+036F, leaving the bare ASCII letter behind. Second, the result is lowercased and any character that is not a-z, 0-9, whitespace, or hyphen is removed. Finally, runs of whitespace and hyphens are collapsed into a single chosen separator.
The variants table extends the same base output. kebab-case is what almost every web framework expects in URLs (Django, Rails, WordPress, Ghost, Hugo, Next.js dynamic routes). snake_case replaces hyphens with underscores and is conventional for Python module names, environment variables, and many database column conventions. dot.case is used by some package managers and DNS-flavored identifiers. camelCase and PascalCase are produced by capitalizing the first letter of each word; they are appropriate for JavaScript identifiers and class names but should not appear in URLs.
Use hyphens, not underscores, in URL slugs. Google's documentation on URL structure states explicitly that hyphens separate words and underscores do not — meaning my_article_title is treated as a single token by the search index while my-article-title is read as three. The same advice applies to all the major search engines and most static site generators.
There are real edge cases this simple algorithm cannot handle. Non-Latin scripts (Chinese, Arabic, Japanese, Cyrillic) get stripped entirely because the regex limits output to a-z and 0-9. For proper romanization (transliteration of 你好 to ni-hao, or Привет to privet), use a dedicated library like slugify or unidecode. Emoji are also dropped silently. If you need internationalized URLs (IRIs), modern browsers support them — but most CMSes still convert to ASCII slugs because of legacy systems and analytics tools that mishandle UTF-8 paths.
SEO considerations: keep slugs under five or six words, include the primary keyword, and put the most distinguishing token earliest. Avoid stop words like the, of, and a unless they meaningfully change the meaning. Numbers are fine — dated slugs like 2026-pricing-update tell users and search engines when the content was written. Once a slug is published, do not change it without setting up a 301 redirect, or you will break inbound links and lose ranking.
Everything happens in your browser via these four primitives: String.normalize, String.replace with regex, String.toLowerCase, and String.split. There is no library import and no network request. Closing the tab discards the input.

Common Use Cases

01

Blog post URLs

Convert article titles to slugs for WordPress, Ghost, Hugo, Astro, or any custom CMS.

02

Product detail pages

Build readable e-commerce URLs from product names while leaving SKU IDs hidden.

03

API path parameters

Generate URL-safe identifiers for REST routes that humans can recognize at a glance.

04

Cross-platform file names

Produce consistent file names that survive Windows, macOS, and Linux without escaping.

Frequently Asked Questions

JavaScript's String.normalize("NFD") splits precomposed characters into a base letter plus combining marks. A second regex strips characters in the U+0300-U+036F range, which is the combining diacritical block. The result is the unaccented Latin letter alone.
The regex keeps only a-z, 0-9, whitespace, and hyphens after lowercasing. Non-Latin scripts do not survive that filter. For proper romanization use a transliteration library like slugify, unidecode, or pinyin.
Hyphen for URLs. Google explicitly treats hyphens as word separators and underscores as part of a single token, so my-best-recipe ranks better than my_best_recipe. Underscores are appropriate for code identifiers and filenames in some traditions, not URLs.
Not with this tool by default. Modern browsers do support Internationalized Resource Identifiers (IRIs) with non-ASCII characters, but most server software, analytics platforms, and link previewers still expect ASCII paths. Most CMSes therefore slugify to ASCII.
Kebab-case uses hyphens (my-article-title) and is the convention for URLs and CSS class names. Snake_case uses underscores (my_article_title) and is conventional in Python modules, database columns, and environment variables.
It is a tradeoff. Date-prefixed slugs make archiving easy but date the content visually. Category-prefixed slugs (/tutorials/setup-guide) help users orient but add friction if you ever reorganize. Pick a structure early and stick with it.
Most CMSes append -2, -3, etc. to disambiguate. This tool produces the canonical slug only — handling uniqueness is the responsibility of whatever stores the records.
No spec-level limit, but search engines truncate the visible URL at around 60 characters in result snippets. Aim for slugs that fit. Avoid the temptation to dump the full title in; trim to the keywords that distinguish the page.
Yes, but always set up a 301 redirect from the old URL to the new one. Without it, inbound links break and search-engine ranking signals get partially reset.
No. The transformation runs entirely in your browser using built-in JavaScript string methods. Nothing is uploaded or logged.

Advertisement