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.
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 libraryThe 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 libraryThe 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 libraryDjango'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 featureEvery 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 toolA 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 toolA 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
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
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
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
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.
https://example.com/My-Awesome-Post
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.
https://example.com/my_first_post
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.
https://example.com/caf%C3%A9-cr%C3%A8me
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.
the-10-absolute-best-and-most-effective-tips-for-writing-faster-javascript-code-in-2026
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.
Input ASCII mode Unicode mode é è ê ë e é è ê ë (kept) ü ö ä u o a kept ñ n ñ (kept) ç c ç (kept) ß ss ß (kept) æ / œ / ø ae / oe / o kept Привет privet привет Λάμδα lamda λάμδα 你好 世界 (dropped) 你好-世界 & and and 🚀 (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?
Should I use hyphens or underscores in a URL slug?
What is the difference between ASCII mode and Unicode mode?
Are Unicode (non-ASCII) URL slugs safe and good for SEO?
How are emojis and special symbols handled?
What's a good maximum length for a slug?
How does the tool handle Chinese, Japanese, Korean, or Arabic text?
Should a URL slug include the date or a number?
Is my text uploaded anywhere?
Related Tools
View all tools →Case Converter — UPPERCASE, lowercase, camelCase & More
Text Processing
Convert text between UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE and 6 more formats instantly. Free, browser-only, no signup.
Lorem Ipsum Generator — Free Placeholder Text Tool
Text Processing
Generate Lorem Ipsum placeholder text instantly — by paragraph, sentence, word, byte, or list. Copy or download as plain text, HTML, Markdown, or JSON. 100% free, private, in-browser. No sign-up.
Free Regex Tester — Debug & Match Patterns Online
Text Processing
Test regex patterns instantly against any text. Live match highlighting, capture groups, replace preview, split, and pattern explainer. JavaScript-flavor regex, 100% private, no signup.
Text Diff & Compare
Text Processing
Compare two texts instantly in your browser. Side-by-side view with inline word-level highlights, unified-diff export, ignore case / whitespace / blank lines. 100% private — your text never leaves your device.
Free Word Counter & Character Count Tool
Text Processing
Count words, characters, sentences, paragraphs, and reading time instantly. Real-time word counter with Twitter, meta description, and Instagram limit checks. Free, private, no signup.
Number Base Converter — Binary, Hex, Decimal & Octal
Conversion Tools
Convert between binary, hex, decimal, octal and any base (2-36) instantly. Free, private — all processing in your browser.