Slug Generator
Generate readable slugs for URLs, files, anchors, and CSS selectors from single titles or batches with Unicode, trimming, and collision checks.{{ primarySlugText || 'Waiting for source text' }}
| Source | Target | Value | Chars | Fit | Copy |
|---|---|---|---|---|---|
| No slug variants yet. | |||||
| {{ row.sourceLabel }} | {{ row.target }} | {{ row.value }} |
{{ row.characters }} | {{ row.fit }} |
| Target | Recommended value | Review | Why | Copy |
|---|---|---|---|---|
| No paste targets yet. | ||||
| {{ row.target }} | {{ row.value }} |
{{ row.review }} | {{ row.why }} | |
Introduction:
Readable titles are not always safe identifiers. A heading such as Quarterly Launch Plan: APAC Beta is clear in a document, but spaces, punctuation, accents, symbols, and mixed case can become structural characters when the same text is pasted into a URL path, file name, anchor, selector, or reporting key.
A slug is the compact identifier made from that title. It keeps the words that make the resource recognizable and replaces fragile separators with a predictable pattern. The result may look minor, but it can become a permalink, redirect target, static file, heading id, CSS hook, analytics label, or config key that other systems depend on later.
- Public URL paths usually favor short lowercase words separated by hyphens.
- File names and CMS permalinks need readable values that do not collide with nearby content.
- Anchors, HTML ids, and CSS selectors need values that still work when pasted into markup or stylesheets.
- Analytics fields, config names, and technical identifiers may prefer underscores, dots, prefixes, or preserved case.
Good slug choices balance recognition, safety, and permanence. A very short slug is easier to scan, but it may be too generic beside similar pages. A long slug preserves more meaning, but it can be harder to compare in redirects, logs, filenames, and navigation. The useful middle ground keeps the words that identify the resource and drops words that will not help someone recognize it later.
International text needs a deliberate policy. Keeping Unicode words can be right for audiences who search and read in that language, while ASCII-safe text is easier to paste into older systems, command lines, and simple routing rules. A visible URL and its encoded form may not look the same, so Unicode slugs should be checked in the destination that will publish or store them.
Renaming a live slug is more than a wording cleanup. Old links, redirects, canonical URLs, bookmarks, analytics reports, and internal references may depend on the previous value. A generated slug is a strong draft, but publishing it still requires a destination and collision check.
How to Use This Tool:
Paste the source text first, then choose the rules that match the destination where the slug will be used.
- Enter a title, heading, route label, product name, or file name in
Source text.Load sampleshows the default behavior before you replace the text. - Turn on
Batch modewhen each non-blank line should produce its own slug. If extra pasted lines appear while batch mode is off, the warning explains that only the first non-blank line is active. - Keep
De-duplicate batch slugsenabled for title lists that may normalize to the same value. Duplicate batch results receive numeric suffixes. - Choose
SeparatorandLetter case. For public URL paths,Hyphen (-)andLowercaseare the conservative starting point. - Set
Character handling. UseASCII-safe, fold accentsfor broad compatibility,Keep Unicode letterswhen the destination accepts encoded non-ASCII paths, orStrict ASCII tokens onlyfor systems that should keep only ASCII word tokens. - Adjust
Maximum length. The limit is clamped to a practical range, andSmart trimbacks up to a whole word when a tight cap would cut through a token. - Open
Advancedonly when you needRemove stop wordsor anID prefixfor anchor and selector variants. - Check
Primary Slug,Slug Variant Ledger, andPaste Target Checklist. Resolve anyReview,Long,Encode, orAdjustedlabel before copying the final value.
Interpreting Results:
The main slug is the recommended candidate under the selected rules. It does not prove that the destination is available, redirected correctly, canonicalized, or safe to rename. Use the checklist as a review aid, then verify the final value in the CMS, router, file tree, stylesheet, or config where it will be pasted.
Primary Slugshows one generated value, or one value per source line whenBatch modeis active.Slug Variant Ledgerreshapes the same source into URL, path, filename, anchor, HTML id, CSS class,snake_case,dot.path, and section-id forms.Paste Target Checklistflags public URL separator choices, long permalink candidates, Unicode paths that may encode, and CSS selector adjustments.Readymeans the value matches that checklist rule. It does not check for duplicate pages, reserved routes, existing files, or old redirects.Adjustedon a selector value means the paste target was made CSS-safe and may not match the primary slug character for character.
Technical Details:
Slug generation is a deterministic text transformation. The source name is split into word-like tokens, symbols such as &, +, @, and % are expanded into words, and camel-case or digit boundaries are separated before joining. The selected character policy, case policy, separator, maximum length, and batch rules decide the final value.
URI syntax explains why conservative slugs avoid reserved punctuation. Characters such as /, ?, and # have structural meaning in a URI, while unreserved letters, digits, hyphen, period, underscore, and tilde can appear as data inside a component. A path segment should not contain slash characters unless the routing system intentionally treats the value as multiple path levels.
Transformation Core:
| Stage | Rule | Effect on Output |
|---|---|---|
| Source cleanup | Blank lines are ignored. Normalize spaces trims each line and collapses repeated spacing. |
Copied titles with stray spacing become stable before tokenization. |
| Token boundaries | Camel-case boundaries, letter-digit boundaries, and digit-letter boundaries are split into separate words. | Roadmap2026 can become separate roadmap and 2026 tokens. |
| Symbol words | &, +, @, and % are expanded to word tokens before joining. |
R&D + QA can keep readable words instead of dropping every symbol boundary. |
| Character handling | ASCII-safe folds accent marks, Unicode keeps Unicode letters, and Strict ASCII keeps ASCII tokens. |
The same title can produce a plain ASCII slug or a Unicode slug that may need percent-encoding in links. |
| Case and stop words | Letter case is lowercased, uppercased, or preserved. Optional stop-word removal drops connector words only when at least one token remains. | Shorter keyword-style slugs are possible without producing an empty result for titles made only of stop words. |
| Length and duplicates | The maximum length is clamped from 8 to 160 characters. Smart trim cuts back to a separator when possible. Batch duplicates receive numeric suffixes. | Long titles stay within the selected cap, and repeated batch titles can remain distinct. |
Target Rules:
| Destination | Generated Form | Caution |
|---|---|---|
| URL segment and path | The primary slug and a leading-slash path variant. | Hyphens are preferred for public word separation. Unicode paths may display as percent-encoded text. |
| Filename | The slug with a .html suffix. |
Check the destination file tree for collisions before creating or renaming files. |
| Anchor and HTML id | A hash anchor and an id="..." form derived from an identifier-safe value. |
Leading digits are prefixed for selector safety, and the same id should not be reused in one document. |
| CSS class | A dot-prefixed selector-safe class value. | CSS identifiers have stricter starting-character and escaping rules than ordinary URL text. |
| Technical names | snake_case, dot.path, and prefixed section-id variants. |
These forms support code, SQL, analytics, config, and design-system conventions, not necessarily public URL style. |
With the default settings, Quarterly Launch Plan: APAC Beta becomes quarterly-launch-plan-apac-beta. The same source then expands into path, filename, anchor, id, class, snake_case, dot.path, and section-id variants so the user can pick the value that matches the paste target.
If the input is Cafe & R&D Roadmap 2026 and stop-word removal is enabled, symbol expansion creates removable connector tokens for and. With hyphen and lowercase settings, the resulting slug is cafe-r-d-roadmap-2026. If no usable token remains after cleanup, the fallback value is item rather than an empty slug.
Worked Examples:
A page title of Quarterly Launch Plan: APAC Beta with the default settings returns quarterly-launch-plan-apac-beta in Primary Slug. Paste Target Checklist marks the search URL and CMS permalink as Ready because the slug uses hyphens and stays under the long-value warning point.
For Cafe & R&D Roadmap 2026, enabling Remove stop words turns the connector words into removable tokens and returns cafe-r-d-roadmap-2026. If the abbreviation matters as a single term in your publishing system, review the source title before copying because punctuation-based abbreviations are split into separate tokens.
A title such as Crème Brûlée Menu shows why Character handling matters. ASCII-safe, fold accents produces creme-brulee-menu, while Keep Unicode letters can preserve crème-brûlée-menu and show an encoded-path warning for systems that display non-ASCII URLs as percent-encoded text.
In a batch with Pricing Update and Pricing Update!, both lines normalize to the same base value. With De-duplicate batch slugs on, Primary Slug keeps pricing-update for the first line and adds pricing-update-2 for the second.
FAQ:
Should public URL slugs use hyphens or underscores?
Hyphens are the safer default for public URL word separation. Underscores and dots are still useful when a route, config name, metric path, or code convention already expects them.
Why did extra pasted lines not generate slugs?
When Batch mode is off, only the first non-blank line is active. Turn on Batch mode to process every non-blank line and show each source in the variant ledger.
What is the difference between ASCII-safe, Unicode, and Strict ASCII?
ASCII-safe folds accents into ASCII letters, Unicode keeps Unicode letters, and Strict ASCII keeps ASCII tokens only. Use the checklist's encoded-path row when Unicode output may be pasted into a URL.
Why did the result become item?
A blank title or a title made only of unsupported characters has no usable word tokens. The generator falls back to item so the result is not empty, but you should replace the source with a real name before publishing.
Is pasted title text sent to a server?
The title is transformed in the current browser session. No pasted title is submitted for slug generation, and copy or download actions use the browser clipboard and local file download behavior.
Glossary:
- Slug
- A readable identifier used in a URL path, file name, anchor, selector, or system key.
- Path segment
- The part of a URL path between slash characters.
- Percent-encoding
- The URL representation that writes a byte as
%followed by two hexadecimal digits. - Unreserved character
- A URI character such as a letter, digit, hyphen, period, underscore, or tilde that has no reserved delimiter purpose.
- Stop word
- A short connector word such as
a,the,of, orfor. - Smart trim
- A length rule that backs up to the previous separator when a maximum length would cut through a word.
- CSS identifier
- An unquoted CSS name used for selectors and other CSS values, with its own starting-character and escaping rules.
References:
- Uniform Resource Identifier (URI): Generic Syntax, RFC Editor, January 2005.
- URL structure best practices for Google Search, Google Search Central, 2025-12-10.
- Percent-encoding, MDN Web Docs, 2025-11-24.
- <ident> CSS type, MDN Web Docs, 2026-05-25.