Skip to content

URL Slug Generator — Slugify Any Text

Slugify any title into a clean, SEO-friendly URL slug instantly. Transliterate accents and Cyrillic, or keep Unicode letters. 100% private, in your browser.

No Tracking Runs in Browser Free
All slug generation happens locally in your browser. No data is sent to any server.
Options
Try an example
Type something above to see its slug.

Reviewed for NFD accent-folding correctness, ASCII vs Unicode mode behaviour, hyphen-vs-underscore SEO guidance, and word-boundary truncation stability. — Go Tools Engineering Team · Jun 24, 2026

What Is a URL Slug?

A URL slug is the part of a web address that identifies a specific page in a human-readable way. In `https://go-tools.org/blog/how-to-write-url-slugs`, the slug is `how-to-write-url-slugs` — the segment after the last slash that names the content. The word comes from newspaper publishing, where a "slug" was the short working name editors gave a story; the web borrowed the term for the short name that identifies a page.

A well-formed slug follows a few conventions that have become near-universal. It's lowercase, because search engines treat URLs as case-sensitive and a consistent lowercase form prevents the same page from being reachable at multiple URLs. It uses hyphens to separate words, because Google reads a hyphen as a word boundary (so `url-slug-generator` is three keywords) but reads an underscore as a word joiner. It strips punctuation and symbols, because characters like `?`, `&`, `#`, and spaces have reserved meanings in URLs or must be percent-encoded, which makes the address ugly and harder to share. And it's concise — long enough to describe the page and carry the target keyword, short enough to read at a glance.

Generating a slug by hand is mechanical but tedious: lowercase the title, replace spaces with hyphens, remove punctuation, fold accented characters, collapse any doubled hyphens, and trim the ends. This tool does all of that in one step, on every keystroke. The interesting decisions are around non-ASCII text. There are two valid philosophies. The first, transliteration (this tool's ASCII mode), converts é to e, ü to u, ß to ss, and Привет to privet, producing a portable pure-ASCII slug that works everywhere. It relies on Unicode NFD normalization to split an accented letter into a base letter plus a combining mark, then discards the mark — a zero-dependency technique built into every JavaScript engine — plus small hand-maintained tables for characters that have no decomposition (ß, æ, ø) and for the Cyrillic and Greek alphabets. The second philosophy, Unicode preservation (this tool's Unicode mode), keeps letters from every script and only lowercases and hyphenates, producing an internationalized slug like 你好-世界. This is exactly the rule GitHub applies when it turns a Markdown heading into an anchor link, and modern browsers and search engines support it fully through the IRI standard.

The slug is one small piece of URL design, but it does real work: it tells human visitors what a page is about before they click, it gives search engines keyword signals, and it makes links readable when shared in chat, email, or social posts. A descriptive slug like /tools/url-slug-generator beats an opaque one like /tools/page?id=4823 on every one of those dimensions.

This tool runs entirely in your browser — the slug updates with no network request, and your text is never uploaded or logged. For related text work, the case converter switches text between camelCase, snake_case, kebab-case and other identifier styles, the URL encoder/decoder handles percent-encoding of full URLs and query strings, and the word counter measures length and reading time. Together they cover most of the text-shaping a developer or content author does before publishing.

// The core of a zero-dependency slugify (ASCII mode)
function slugify(input) {
  return input
    .normalize('NFD')                 // café → cafe + combining accent
    .replace(/[\u0300-\u036f]/g, '')  // drop the combining marks
    .replace(/ß/g, 'ss')              // chars with no NFD decomposition
    .replace(/&/g, ' and ')           // keep the meaning of '&'
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, '-')      // every other run of junk → one hyphen
    .replace(/^-+|-+$/g, '');         // trim leading / trailing hyphens
}

slugify('Crème Brûlée Recipe');   // 'creme-brulee-recipe'
slugify('Salt & Pepper');         // 'salt-and-pepper'
slugify('10 Tips: A Guide!');     // '10-tips-a-guide'

Key Features

Two Transliteration Modes

ASCII mode folds accents and romanizes Cyrillic and Greek to a portable a–z slug; Unicode mode keeps letters from any script, GitHub-anchor style. One toggle covers both the "make it portable" and the "keep my language" use cases that other tools force you to choose between.

Accurate Accent Folding

Uses Unicode NFD normalization to fold café → cafe, naïve → naive, and Zürich → zurich, plus explicit handling for characters that have no decomposition (ß → ss, æ → ae, ø → o). The result is correct for French, Spanish, Portuguese, German, the Nordic languages, and more.

Real-Time, No Convert Button

The slug updates on every keystroke and every option change — no button to click, no page reload. Paste a title, read the slug, copy it. Built for the speed of actually publishing.

Separator, Case, and Length Controls

Switch between hyphen and underscore separators, keep or drop lowercasing, and cap the slug at a maximum length that truncates on a word boundary rather than mid-word. Sensible defaults (hyphen, lowercase, no limit) match SEO best practice out of the box.

Smart Ampersand Handling

The ampersand is expanded to "and" so "Salt & Pepper" becomes salt-and-pepper instead of silently dropping a word. Runs of any other punctuation collapse into a single separator, so you never get doubled or trailing hyphens.

Shareable Permalink

Your input and option choices are encoded into the page URL, so you can share a link that reproduces the exact slug you generated — handy for documenting a naming decision in a ticket or pull request.

100% Browser-Based Privacy

Every slug is generated locally in your browser. Your text is never uploaded, logged, or analyzed — safe for unannounced product names and draft titles. Zero network requests as you type; verify it in your browser's Network tab.

Slug Generator Alternatives Compared

slugify (npm package)

JavaScript library

The most popular Node slugify library — configurable separator, lowercase, custom replacements, and a transliteration map. Use it in your build pipeline to generate slugs programmatically; use this tool for one-off slugs and to preview how a title will look before you commit to it in code.

github-slugger

JavaScript library

The library that powers GitHub's heading anchors — it keeps Unicode letters (doesn't transliterate) and de-duplicates repeated slugs on a page. This tool's Unicode mode reproduces its keep-the-letters behaviour, which is what you want when matching in-page anchor links in Markdown docs.

Django slugify / Python-slugify

Python library

Django's built-in slugify transliterates to ASCII; the third-party python-slugify adds Unicode handling and more options. Both are server-side. This browser tool gives you the same transliteration result interactively, with no Python environment needed, for quick checks and content work.

WordPress / Ghost / Hugo auto-slug

CMS feature

Every major CMS auto-generates a slug from the title on save. They're convenient but give you little control and often leave in stop words or awkward truncation. Use this tool to craft and shorten the slug deliberately, then paste it into the CMS's slug field to override the auto-generated one.

it-tools Slugify

browser tool

A clean open-source slugify in the popular it-tools suite — transliterates and lowercases with a fixed behaviour. This tool adds an explicit ASCII/Unicode mode toggle, separator and length controls, smart ampersand handling, and full worked examples and best-practice guidance for the non-Latin and SEO edge cases.

convertcase.net slug tool

browser tool

A long-running text-utility site with a basic slug option focused on Latin text. This tool goes further on internationalization (Cyrillic/Greek romanization, a Unicode-preserving mode) and on the SEO decisions — separator choice, length capping, and the hyphen-vs-underscore rationale — that determine whether a slug actually ranks.

Slug Generator Examples

Blog Post Title → URL Slug

10 Tips for Faster JavaScript: A Complete Guide!
10-tips-for-faster-javascript-a-complete-guide

The colon, the exclamation mark, and the capital letters are all normalized away. The result is the exact kebab-case slug WordPress, Ghost, and Hugo generate by default — drop it straight into the slug field. Numbers are preserved, so "10" stays at the front where it carries keyword value.

Accented Title (ASCII mode) → Transliterated Slug

Crème Brûlée Recipe
creme-brulee-recipe

ASCII mode folds the accents using Unicode NFD normalization: è → e, û → u. The slug is pure ASCII, so it works in every URL, filename, and database key without percent-encoding. This is the behaviour most CMS platforms expect for European-language titles.

German Title with ß and Umlauts

Große Änderungen für 2026
grosse-anderungen-fur-2026

ß has no NFD decomposition, so it is mapped explicitly to "ss". The umlauts ä and ü fold to a and u. Note: this uses the simple international convention (ä → a); if your house style requires the German ae/oe/ue spelling, edit the slug after copying.

Cyrillic Title (ASCII mode) → Romanized Slug

Привет мир
privet-mir

A compact Cyrillic-to-Latin table romanizes the whole phrase so it becomes a readable ASCII slug instead of an empty string. Switch to Unicode mode and the same input stays привет-мир, keeping the original script for a Russian-language audience.

CJK Title in Unicode Mode

你好 世界
你好-世界

Chinese, Japanese, and Korean ideographs have no ASCII transliteration here, so ASCII mode returns an empty slug. Unicode mode keeps the letters and just hyphenates — the modern, standards-compliant approach for internationalized URLs that GitHub uses for its heading anchors.

Symbols and Ampersand → Readable Words

Salt & Pepper: 100% Natural
salt-and-pepper-100-natural

The ampersand is expanded to "and" so the word survives instead of disappearing. The percent sign and colon are stripped as unsafe URL characters, while the digits in "100" are kept. The result reads cleanly and carries every meaningful keyword.

How to Use the Slug Generator

  1. 1

    Paste or type your text

    Click into the editor and enter a title, heading, or phrase — or tap one of the preset chips (Blog title, Accents, CJK, Cyrillic, Symbols) to load a representative example. The slug appears instantly in the output box below.

  2. 2

    Choose ASCII or Unicode mode

    Leave Mode on ASCII for a portable a–z slug that transliterates accents and romanizes Cyrillic/Greek. Switch to Unicode if your text is in a non-Latin script (Chinese, Arabic, Cyrillic) and you want to keep the original characters in the URL.

  3. 3

    Adjust separator, case, and length

    Keep the hyphen separator (recommended) or switch to underscore. Lowercase is on by default; turn it off to preserve casing. Set a Max length to cap long slugs at a word boundary, or leave it at 0 for the full slug.

  4. 4

    Copy the slug

    Click Copy to write the finished slug to your clipboard — the button flashes "Copied!" to confirm. Paste it into your CMS slug field, filename, or anchor id. Click Reset to clear the editor and start over.

Common Slug Mistakes

Leaving Capital Letters in the Slug

Because URLs are case-sensitive to search engines, a mixed-case slug can make the same page reachable at several addresses (/My-Post and /my-post), splitting link signals and risking duplicate-content treatment. Always lowercase slugs unless a system specifically requires otherwise.

✗ Wrong
https://example.com/My-Awesome-Post
✓ Correct
https://example.com/my-awesome-post

Using Underscores Instead of Hyphens

Underscores join words in Google's eyes, so my_first_post is read as a single token rather than three keywords. Hyphens separate words and are the SEO-recommended, CMS-standard choice. Switch the separator to underscore only when a downstream system forces it.

✗ Wrong
https://example.com/my_first_post
✓ Correct
https://example.com/my-first-post

Leaving Raw Non-ASCII Characters in the URL

Pasting a title with accents or symbols straight into a URL field can produce percent-encoded soup when the address is copied (caf%C3%A9-cr%C3%A8me). Either transliterate to ASCII (café → cafe) or deliberately choose Unicode mode and accept the encoding — don't leave half-encoded, accidental characters in the slug.

✗ Wrong
https://example.com/caf%C3%A9-cr%C3%A8me
✓ Correct
https://example.com/cafe-creme

Stuffing the Whole Title into the Slug

A 90-character slug that repeats the entire headline word-for-word is hard to read, gets truncated in search snippets, and dilutes the keyword. Trim it to the core phrase. Use the Max length option to cap the slug and drop stop words for a tighter URL.

✗ Wrong
the-10-absolute-best-and-most-effective-tips-for-writing-faster-javascript-code-in-2026
✓ Correct
faster-javascript-tips

Who Uses a Slug Generator

Bloggers and Content Authors
Turn a post title into the URL slug your CMS expects. Paste "10 Tips for Faster JavaScript: A Complete Guide" and copy `10-tips-for-faster-javascript-a-complete-guide` straight into the WordPress, Ghost, or Hugo slug field — keyword-rich and clean.
SEO Specialists
Craft short, keyword-focused slugs that read well in search results and carry click-through value. Use the Max length control to keep slugs under ~60 characters and drop stop words for a tighter, more relevant URL.
Developers Naming Routes and Files
Generate safe identifiers for route paths, static-file names, image asset names, and storage keys from human-readable labels. ASCII mode guarantees the result is portable across filesystems and databases that choke on non-ASCII characters.
Documentation and Markdown Authors
Reproduce the heading-anchor slugs that GitHub, GitLab, and most static-site generators create from headings, so your in-page "#section" links match. Unicode mode mirrors GitHub's keep-the-letters behaviour for non-English headings.
Internationalized Sites
Choose per-language behaviour: transliterate European titles to ASCII for maximum compatibility, or switch to Unicode mode to keep Chinese, Cyrillic, or Greek characters in the URL for native-script readers. Both are valid; the toggle lets you decide per page.
E-commerce and Catalog Teams
Generate stable product and category slugs from product names — including accented brand names and symbols. Smart ampersand handling means "Salt & Pepper" becomes salt-and-pepper instead of losing the word, keeping the product name searchable.

How Slugification Works

Unicode NFD Normalization for Accents
Accented Latin letters are folded by normalizing the string to NFD (Canonical Decomposition), which splits a character like é into the base letter e plus a combining acute accent (U+0301), then stripping the combining marks in the range U+0300–U+036F. This is a built-in, zero-dependency capability of every JavaScript engine and covers the accents of French, Spanish, Portuguese, Italian, German umlauts, and the Nordic and Central European languages. Characters with no canonical decomposition — ß, æ, œ, ø, đ, ł, þ — are handled by a small explicit map (ß → ss, æ → ae, and so on).
Cyrillic and Greek Romanization
ASCII mode includes compact, hand-maintained transliteration tables for the Cyrillic and Greek alphabets, so Привет мир becomes privet-mir and Λάμδα becomes lamda. The Cyrillic table uses the common Russian romanization scheme. CJK ideographs and Arabic script are intentionally not transliterated in ASCII mode — full pinyin/romaji conversion requires large dictionaries and produces ambiguous output — so for those scripts, Unicode mode (which preserves the characters) is the recommended choice.
Transliteration Cheat Sheet
The table below shows how representative characters behave in each mode. ASCII mode aims for a portable a–z, 0–9 slug; Unicode mode keeps any letter or digit.

InputASCII modeUnicode mode
é è ê ëeé è ê ë (kept)
ü ö äu o akept
ñnñ (kept)
çcç (kept)
ßssß (kept)
æ / œ / øae / oe / okept
Приветprivetпривет
Λάμδαlamdaλάμδα
你好 世界(dropped)你好-世界
&andand
🚀 (emoji)(dropped)(dropped)
Separator Collapsing and Trimming
After transliteration, every run of characters that isn't a letter or digit is replaced by a single separator. This means doubled and tripled punctuation can never produce doubled separators: "a---b__c" becomes a-b-c. Leading and trailing separators are trimmed, so a title that starts or ends with punctuation never yields a slug with a dangling hyphen. The ampersand is expanded to "and" before this step so the word is preserved.
Word-Boundary Truncation
When you set a maximum length, the slug is cut to that length and then, if the cut landed in the middle of a word, backtracked to the previous separator so you never get a half-word at the end. A trailing separator left by the cut is removed. At least one word is always kept, even if the first word is longer than the limit. Set the limit to 0 to disable truncation entirely.
Case Sensitivity and Lowercasing
URLs are case-sensitive by specification — /About and /about are different addresses to a search engine — so the tool lowercases by default to avoid the same content being reachable at multiple URLs (a duplicate-content risk). In Unicode mode, lowercasing applies to scripts that have case (Latin, Cyrillic, Greek) and is a no-op for scripts that don't (CJK). Turn the Lowercase option off when a downstream system requires the original casing preserved.

URL Slug Best Practices

Keep Slugs Short and Keyword-Focused
Aim for roughly 3–6 meaningful words, ideally under about 60 characters. A short slug is easier to read, less likely to be truncated in search results, and cleaner when shared. Include the page's target keyword and drop filler — stop words like a, the, of, and for can almost always be removed without losing clarity.
Use Hyphens, Not Underscores or Spaces
Google treats hyphens as word separators and underscores as word joiners, so hyphens give each word its own keyword signal. Spaces have to be percent-encoded as %20, which makes URLs ugly. Hyphens are the universal CMS convention — this tool defaults to them for good reason.
Never Change a Published Slug
A slug is a permanent address. Changing it after publishing breaks every existing inbound link, bookmark, and social share, and resets the page's accumulated SEO value unless you set up a 301 redirect. Decide on the slug before you publish, and if you must change it later, always add a redirect from the old slug to the new one.
Pick ASCII or Unicode Deliberately
For a broad or international audience, ASCII transliteration maximizes compatibility and keeps URLs clean when copied as text. For a single-language non-Latin audience (a Chinese, Russian, or Greek site), Unicode slugs are more readable to your actual readers and are fully supported by modern search engines. Match the mode to who will read the URL.
Leave Dates Out of the Slug
Don't bake a year or date into the slug (/2024-buyers-guide). When you refresh the content later, you're stuck with a stale date in the URL or a slug change that breaks links. Store the publish date in your CMS metadata instead, and keep the slug timeless so the same URL can carry updated content for years.

Frequently Asked Questions

What is a URL slug?
A URL slug is the human-readable identifier at the end of a web address that names a specific page — in `https://go-tools.org/blog/url-slug-best-practices`, the slug is `url-slug-best-practices`. Slugs are lowercase, use hyphens instead of spaces, strip punctuation, and ideally contain the page's target keywords. A good slug is short, descriptive, and stable (it shouldn't change after publishing, because changing it breaks every existing link). This tool converts any title or phrase into that form automatically, so you don't have to lowercase, hyphenate, and strip characters by hand.
Should I use hyphens or underscores in a URL slug?
Use hyphens. Google has stated for years that it treats hyphens as word separators in URLs but treats underscores as word joiners — so `url-slug-generator` is read as three words ("url", "slug", "generator") while `url_slug_generator` can be read as one token. Hyphens are the universal convention across WordPress, Ghost, Hugo, and virtually every modern CMS. This tool defaults to hyphens for that reason, but offers an underscore option for the cases where a downstream system requires it (some file naming schemes and legacy databases).
What is the difference between ASCII mode and Unicode mode?
ASCII mode transliterates every non-ASCII character to its closest Latin equivalent and drops anything it can't convert, producing a pure a–z, 0–9 slug: café → cafe, Привет → privet, 你好 → (dropped). It's the safest, most portable option and what most CMS platforms expect. Unicode mode keeps letters from any script (Chinese, Arabic, Cyrillic, Greek) and only lowercases and hyphenates, producing an internationalized slug like 你好-世界 — the same rule GitHub uses for heading anchors. Use ASCII mode by default; use Unicode mode when your URLs are meant for readers of a non-Latin script and you want the original characters preserved.
Are Unicode (non-ASCII) URL slugs safe and good for SEO?
Yes, with caveats. Modern browsers display Unicode characters in URLs (the IRI standard, RFC 3987) and transparently percent-encode them on the wire, and Google indexes and ranks them correctly — a slug like /статьи/привет is fully supported. The trade-offs: when copied as plain text the URL may appear percent-encoded (%D0%BF%D1%80...), which looks ugly, and some older systems or analytics tools handle the encoding imperfectly. The rule of thumb: if your audience reads the script natively, Unicode slugs improve readability and click-through; if your audience is international or you want maximum compatibility, ASCII transliteration is the safer choice.
How are emojis and special symbols handled?
Emojis and pictographic symbols are removed in both modes, because they are not letters or digits and have no place in a clean URL. So "🚀 Launch Day" becomes `launch-day` in either mode. Among punctuation, the ampersand (&) is a special case: it's expanded to the word "and" by default so you don't silently lose meaning ("Salt & Pepper" → `salt-and-pepper`). Everything else — colons, slashes, quotes, percent signs, parentheses — is treated as a separator and collapsed into a single hyphen, so runs of punctuation never produce doubled separators.
What's a good maximum length for a slug?
There's no hard limit, but shorter is better. Most SEO practitioners aim for slugs under about 60 characters or roughly 3–6 meaningful words — long enough to be descriptive and contain the target keyword, short enough to read at a glance and not get truncated in search results or when shared. This tool's Max length option truncates at a word boundary (it won't cut a word in half) so you can cap a long title cleanly. Set it to 0 to keep the full slug. Remember that stop words (a, the, of, for) can usually be dropped without hurting clarity, which is the easiest way to shorten a slug.
How does the tool handle Chinese, Japanese, Korean, or Arabic text?
It depends on the mode. In ASCII mode, CJK ideographs and Arabic script have no built-in transliteration here, so they're dropped and you may get an empty slug — ASCII mode is designed for Latin, Cyrillic, and Greek source text. In Unicode mode, the characters are preserved: 你好 世界 becomes 你好-世界 and مرحبا بالعالم keeps its Arabic letters, lowercased and hyphenated. For CJK and Arabic audiences, Unicode mode is the right choice. (Full pinyin or romaji transliteration of Chinese and Japanese is a deliberately out-of-scope feature, because it requires large dictionaries and produces ambiguous results.)
Should a URL slug include the date or a number?
Generally avoid putting dates in the slug itself. A slug like /2024-best-laptops ages badly — when you update the article in 2026 you either keep a misleading 2024 in the URL or change the slug and break inbound links. Keep dates out of the slug and let your CMS store the publish date separately. Numbers that are part of the meaning (list counts like "10 tips", version numbers, model numbers) are fine and often valuable for click-through — this tool preserves digits, so "10 Tips for X" keeps the "10". The principle is: include numbers that are part of the topic, exclude dates that will go stale.
Is my text uploaded anywhere?
No. Every slug is generated 100% in your browser with JavaScript. Your text is never transmitted, never stored on any server, never logged, and never analyzed. You can verify in your browser's Network tab — typing in the editor or clicking Copy triggers zero network requests. This makes the tool safe for unannounced product names, draft article titles, internal document names, and any other confidential material. The shareable link feature encodes your input into the URL only in your own browser; nothing is sent anywhere until you choose to share that link.

Related Tools

View all tools →