URL Slug Generator
Generate clean, SEO-friendly URL slugs from any text instantly online. Removes accents, special characters, and converts spaces to hyphens. Free slug generator tool.
Related Tools
Markdown → HTML
Convert Markdown to clean HTML instantly. Supports GFM, tables, code blocks, and more.
Case Converter
Convert text to camelCase, PascalCase, snake_case, kebab-case, and more — all at once.
HTML → Markdown
Convert HTML to clean Markdown instantly. Supports headings, links, lists, tables, and code blocks.
A URL slug is a URL-safe, human-readable identifier derived from a title or phrase by lowercasing all characters, replacing spaces with hyphens, removing special characters, and stripping diacritics from accented letters. Slugs form the path component of URLs for blog posts, product pages, and CMS content items, where they must be stable, unique, and readable by both humans and search engines.
SEO best practice requires descriptive, hyphen-separated URL slugs rather than numeric IDs or underscored strings. Google explicitly recommends hyphens over underscores in URLs because it treats hyphens as word separators. CMS platforms like WordPress, Ghost, and Strapi auto-generate slugs, but developers often need to pre-generate slugs for bulk content imports, API payloads, or static site generators.
This tool converts text to slugs using Unicode NFD (Canonical Decomposition) normalization, which separates base characters from their combining diacritical marks, followed by stripping all combining characters. Spaces become hyphens, non-alphanumeric characters are removed, and consecutive hyphens are collapsed. All processing runs in the browser with no external library.
Common Use Cases
Bulk importing blog posts to Ghost CMS
Ghost's JSON import format requires a slug field for each post. When migrating hundreds of posts from a spreadsheet or another CMS, titles with accented characters (Spanish, French, German) produce incorrect slugs if processed naively. This tool's NFD diacritic removal ensures 'Ñoño' becomes 'nono' rather than containing literal Unicode characters that Ghost's URL router rejects.
Generating Next.js dynamic route segments
Next.js file-system routing uses directory names as URL segments. When building a static site with getStaticPaths, the params.slug values must be URL-safe strings derived from content titles. Pre-generating slugs here and storing them in the content source (Contentful, Sanity, or a markdown frontmatter file) ensures route consistency at build time.
Creating Shopify product handle values
Shopify uses a handle field (their term for slug) in product and collection URLs. When importing a product catalog via the Shopify CSV import format, the Handle column must contain valid slugs. Generating handles from product names here before preparing the CSV avoids the import errors Shopify raises for handles containing spaces or special characters.
Seeding database permalink columns
Content tables in PostgreSQL or MySQL often include a slug column with a unique constraint for URL routing. When inserting records programmatically from a spreadsheet or API, generating slugs from title strings here and verifying they contain no problematic characters prevents constraint violations and routing errors in the deployed application.
How to Use the Slug Generator
- Type or paste your article title or text in the left panel.
- The URL-friendly slug appears instantly in the right panel.
- Click Copy Output to copy the slug.
- Use Load Example to see a sample conversion.
Transformations Applied
- Lowercases all characters
- Removes diacritical marks (é → e, ü → u, ñ → n)
- Strips non-alphanumeric characters
- Converts spaces and underscores to hyphens
- Trims leading and trailing hyphens