Slug Generator
Developer Tools
Turn any title, sentence, or string into a URL-safe slug. Choose your separator, strip diacritics, control max length, and run single or batch conversions.
Runs entirely in your browserAbout Slug Generator
A slug is the hyphenated, lowercase tail of a URL — the part that comes after the domain and identifies the page. Bloggers, CMS authors, e-commerce stores, and content management workflows generate them constantly. Good slugs are short, lowercase, ASCII-only, and use hyphens as word separators because that's the SEO convention every major search engine and analytics platform expects.
This generator handles the messy parts: NFKD normalization to strip diacritics (so `café` becomes `cafe`), explicit replacement for letters that don't decompose cleanly (`ß` → `ss`, `Æ` → `ae`, `Ø` → `o`, etc.), collapsing of consecutive separators, and word-aware truncation that breaks on a separator rather than mid-word when possible. You can switch to underscores or dots for separator if your stack prefers those, toggle off strict ASCII mode to preserve Unicode letters in URLs that target multilingual audiences, and run a batch through to slugify an entire list of titles at once. All processing is local in your browser.
How to use
- 1
Set your options
Pick a separator (hyphen is the SEO default), toggle lowercase, choose strict ASCII vs Unicode, and optionally cap the length.
- 2
Pick Single or Batch mode
Single converts one input at a time with a live output field. Batch takes a textarea of one item per line and outputs line-aligned slugs.
- 3
Type or paste your text
The slug updates live as you type. The character count appears below the output.
- 4
Copy or download
Use the Copy button for single mode, or Download the batch result as a .txt file.
Examples
Headline to slug
Input
10 Things Every Developer Should Know in 2026Output
10-things-every-developer-should-know-in-2026Diacritics stripped
Input
Café Résumé ÜberOutput
cafe-resume-uberLength-capped without splitting words
Input
A really long title that exceeds the maximum lengthOutput
a-really-long-title-that-exceeds (with maxLength=32)Frequently asked questions
Why hyphens instead of underscores?+
Google explicitly recommends hyphens because their search engine treats `-` as a word separator and `_` as a word joiner. So `hello-world` indexes as two words; `hello_world` indexes as one. Always use hyphens unless your CMS specifically requires underscores.
What does strict ASCII mode do?+
Strict mode strips everything to `[a-z0-9-]`. Non-strict preserves Unicode letters and numbers (`\p{L}` and `\p{N}` regex classes), so you can have slugs like `café-résumé`. Most international CMSes handle these fine; older systems and some analytics tools choke on them.
How does diacritic stripping work?+
We use Unicode NFKD normalization, which decomposes accented characters into a base letter plus a combining diacritic mark. Then we remove the combining marks. A few letters that don't decompose cleanly (ß, Æ, Ø, Þ, đ) get explicit pre-replacements.
What about Cyrillic, Greek, Arabic, or CJK?+
Those scripts don't have ASCII-letter equivalents, so strict mode strips them entirely. If your audience reads those scripts, switch to non-strict mode so the URLs preserve the original characters. For ASCII transliteration of Cyrillic (`Москва` → `moskva`), you'd need a dedicated transliteration library — `@sindresorhus/slugify` is the standard choice.
How does length truncation handle word boundaries?+
When `maxLength` is set and the slug exceeds it, we look for the last separator within the cap and truncate there. If there's no separator past 60% of the limit, we just truncate at the limit to avoid producing a one-word slug.
Is my input sent anywhere?+
No. Slug generation is a pure-JavaScript function running in your browser.
Related tools
JSON Formatter
Format, beautify, and explore JSON with an expandable tree view. Includes indent control and minify.
JSON Validator
Validate JSON structure and pinpoint syntax errors by line and column.
HTML Formatter
Clean and indent messy HTML for better readability.
CSS Formatter
Format and organize CSS automatically with configurable brace and indent styles.
SQL Formatter
Beautify SQL queries with proper indentation across Postgres, MySQL, SQLite, and MSSQL dialects.
XML Formatter
Format XML into a clean, readable structure with attribute control.