slugify

URL slug generation library. Converts strings to URL-safe slugs by replacing spaces with hyphens, removing special characters, transliterating Unicode characters to ASCII, and lowercasing. Supports 200+ Unicode character transliterations (German umlauts, French accents, Cyrillic, Arabic, etc.). Used for generating SEO-friendly URLs from titles, blog post slugs, and file name sanitization.

Evaluated Mar 07, 2026 (0d ago) v1.x
Homepage ↗ Repo ↗ Developer Tools slug url string unicode seo node browser javascript
⚙ Agent Friendliness
70
/ 100
Can an agent use this?
🔒 Security
99
/ 100
Is it safe for agents?
⚡ Reliability
96
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
90
Error Messages
88
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
95
Secret Handling
100

Zero security surface — pure string transformation. Output should still be validated/sanitized if used in database queries or file paths.

⚡ Reliability

Uptime/SLA
98
Version Stability
95
Breaking Changes
95
Error Recovery
98
AF Security Reliability

Best When

You need to convert human-readable strings to URL-safe, lowercase hyphenated slugs with Unicode support.

Avoid When

You need unique guarantees — slugify is deterministic but not unique; two different strings may produce the same slug.

Use Cases

  • Generate URL slugs from blog post or product titles: 'Hello World!' → 'hello-world'
  • Create file system-safe names from user-provided strings by removing special characters
  • Generate database-friendly identifiers from display names for URL routing
  • Transliterate international characters to ASCII for ASCII-only URL requirements: 'Üniversität' → 'universitaet'
  • Sanitize user-provided names for use as route parameters or subdomain identifiers

Not For

  • Unique ID generation — slugify doesn't guarantee uniqueness; check for collisions in your data store
  • Complex URL manipulation — use the URL API or path libraries for full URL parsing/building
  • Unicode normalization for non-URL purposes — use unorm or native String.normalize() for general Unicode normalization

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — string utility library.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

Fully free, MIT licensed.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

Known Gotchas

  • Slugs are NOT unique — 'Hello World' and 'Hello World!' both produce 'hello-world'; implement uniqueness via database constraints and collision handling (append counter)
  • Entirely non-ASCII input with no transliteration may produce empty string — check for empty output and handle: if (!slug) use a fallback ID
  • strict: true mode removes all characters not in the allow list — may be too aggressive for titles with valid punctuation; test your expected input range
  • Custom character mappings via extend() option — for domain-specific transliteration (technical symbols, currency signs) that default mapping doesn't cover
  • Trimming: input whitespace at start/end is trimmed by default — but multiple consecutive spaces between words are collapsed to single hyphen
  • max length: slugify doesn't enforce max slug length — long titles produce long slugs; truncate to URL-safe length after slugifying to prevent URL length limit issues

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for slugify.

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-07.

6470
Packages Evaluated
26150
Need Evaluation
173
Need Re-evaluation
Community Powered