Skip to main content
AllDevToolsHub
🔗

Slug Generator

100% Local

Convert any text into a URL-friendly slug with Unicode support.

Slug Generator
how-to-build-a-rest-api-with-nodejs35 chars
Try:
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.

Type a title or paste text. The slug converts to lowercase with hyphens and strips special characters.

Overview

What is Slug Generator?

Transform text into clean URL slugs with full Unicode transliteration (accents, umlauts). Supports kebab-case, snake_case, camelCase, and dot.case styles.
FAQ

Frequently Asked Questions

Reference

Technical Deep Dive

GENERATORS

Slug Generator

Transform text into clean URL slugs with full Unicode transliteration (accented characters, umlauts, etc.). Supports kebab-case, snake_case, camelCase, and dot.case styles with configurable max length.

Instant Generation

Type, tweak, copy, no waiting on a server round-trip or sign-up flow.

🎛

Fine-Grained Control

Every knob you'd reach for is exposed, with sensible defaults for the common case.

🧪

Verified Output

Generated values are sanity-checked against spec or canonical implementations.

01 Slug Convention Matrix

Style Example Output Standard Use Case SEO Value
Kebab Casemy-slug-nameWeb URL Paths (Standard)High
Snake Casemy_slug_nameFilenames, DB KeysMedium
Camel CasemySlugNameAPI Responses, JS PropsLow
Dot Casemy.slug.namePackage RoutingLow

02 Normalization Pipeline

1
Transliteration Accented Unicode characters (e.g., é, ñ, ö) are mapped to their closest ASCII equivalents to ensure universal browser compatibility.
2
Sanitization Punctuation, emoji, and non-conforming symbols are stripped, and consecutive whitespace is collapsed into the chosen separator.
3
Serialization The normalized string is truncated to the target max length and converted to the specified case style for final output.

03 Where Slugs Show Up

A slug is any human-readable identifier that has to survive URL transport, filesystem rules, and shell quoting. The same normalization logic powers each, once you understand RFC 3986's reserved characters, you understand all of them.

  • 📝
    Blog post URLs "How to Debug CORS Errors" → /blog/how-to-debug-cors-errors. The slug becomes part of the canonical URL and gets indexed by search engines, kebab-case is the standard because Google treats hyphens as word boundaries but underscores as joiners.
  • 🏷️
    SEO-friendly product IDs "Wool Cardigan, Olive, Size L" → wool-cardigan-olive-size-l. Pair with a stable numeric ID in the URL (/p/12345/wool-cardigan-olive-size-l) so you can rename the slug without breaking external links.
  • ☁️
    S3 / blob storage filenames S3 keys allow most characters but break in subtle ways with spaces, +, and certain Unicode. Slugifying user-uploaded filenames before storing them avoids URL-encoding surprises in presigned URLs.
  • 🌿
    GitHub branch names from issue titles "Fix CORS error in /api/users (regression from #4321)" → fix-cors-error-in-api-users-regression-from-4321. Git refuses certain characters (:, ?, *, spaces). Slugification handles all of them in one pass.
  • 📐
    RFC 3986 as the spec floor RFC 3986 § 2.3 defines the unreserved character set: ALPHA / DIGIT / "-" / "." / "_" / "~". Any character outside this set must be percent-encoded, which is ugly. Slug generation transliterates them away to keep URLs clean.

04 Worked Examples

EXAMPLE 1 · UNICODE NORMALIZATION
Input:
Café 25¢, naïve
Slug:
cafe-25c-naive

The pipeline applies Unicode UAX #15 NFKD normalization, which decomposes é into e + U+0301 (combining acute). Strip combining marks and you get plain e. ¢ has a compatibility decomposition to c under NFKD; emoji and symbols without ASCII equivalents are dropped.

EXAMPLE 2 · RESERVED-WORD COLLISION
Dangerous slug candidates:
"API Reference"      → api

"Admin Panel" → admin
"How to Handle Null" → null
"New Post" → new (some frameworks reserve)


Defensive approach:

/blog/api-reference        (namespace under /blog/)
/admin (route reserved for app)
/blog/how-to-handle-null (namespace prefix saves you)

Always namespace user-generated slugs under a route segment (/blog/, /u/, /p/). Otherwise a user can title their post "Admin" and steal the admin URL. Maintain a denylist of reserved slugs (api, admin, null, undefined, your framework's reserved routes) for the rare slugs that escape namespacing.




EXAMPLE 3 · COLLISION HANDLING

Two posts with the same title:

Post 1: "Year in Review"  → year-in-review
Post 2: "Year in Review" → year-in-review ← conflict!

Resolution strategies:

Numeric suffix:   year-in-review-2
Year disambig: year-in-review-2024
Random suffix: year-in-review-a3f9
Hash suffix: year-in-review-7c4e2b (stable hash of id)

Numeric suffixes are most readable but require a DB lookup ("does this slug exist?") at insert time. Random or hash suffixes avoid the lookup but trade away readability. Pick numeric for low-volume content (blogs), random for high-volume user-generated paths (social posts).




05 Related Tools

Slugs sit between editorial input and URL output. These tools handle the surrounding stages.

You Might Also Need