Codepackr / utilities / Slugify Tool

Slugify Tool

Convert titles and phrases into clean, URL-friendly kebab-case slugs.

Client-Side Execution & Privacy Guarantee

This utility executes 100% locally in your web browser. Your inputs, tokens, queries, and data payloads are never transmitted to any external server or backend.

A slug is the readable portion of a URL that identifies a specific page. Search engines and humans both prefer short, hyphen-separated words over spaces, punctuation, or mixed case. This tool converts ordinary titles into that format instantly so you can paste the result straight into a CMS, route definition, or database column.

The conversion follows common conventions used by WordPress, GitHub, and most static-site generators: lowercase letters, hyphens as word separators, and removal of anything that would break a URL. Accented characters are folded to their ASCII equivalents so the slug remains portable across systems.

How kebab-case is formed

Every sequence of whitespace or punctuation is collapsed into a single hyphen. Leading and trailing hyphens are stripped, and consecutive hyphens are reduced to one. The result never starts or ends with a hyphen and never contains uppercase letters.

Characters outside the basic Latin alphabet are transliterated when possible (é becomes e, ñ becomes n). Characters that have no reasonable ASCII mapping are simply dropped. This keeps the slug both human-readable and safe for older file systems and proxies.

Length and uniqueness considerations

Most CMS platforms and SEO guidelines recommend keeping slugs under 50–60 characters. Longer titles are truncated at a word boundary rather than mid-word so the remaining text still makes sense. You can optionally append a short unique suffix if two pages would otherwise produce identical slugs.

Because the algorithm is deterministic, the same title always yields the same slug. That property is useful for bulk imports and for generating stable preview links, but it also means you must handle collisions yourself when two distinct titles normalize to the same string.

Edge cases the tool resolves

Titles that consist only of punctuation or emoji produce an empty result; the tool surfaces a clear warning so you can supply a fallback. Mixed-script titles (for example, English mixed with Cyrillic or CJK) keep the Latin portions and drop the rest, matching the behavior of most popular slug libraries.

Numbers are preserved exactly, including leading zeros. Apostrophes inside words are removed rather than turned into hyphens, so “don’t” becomes “dont” instead of “don-t”. These small decisions match the majority of production slug generators.

When to use this tool

  • Creating permalinks for blog posts or product pages
  • Generating file names from user-supplied titles
  • Building route segments in a web framework
  • Normalizing tags or category names for URLs
  • Preparing bulk import data that must be URL-safe

How to use the Slugify Tool

  1. Paste or type the original title into the input field.
  2. Choose whether to enforce a maximum length (default 60 characters).
  3. Optionally enable or disable accent folding if you need to preserve certain characters.
  4. Click Convert. The slug appears in the output box immediately.
  5. Copy the result with the button provided.
  6. If the slug is empty, edit the source title and try again.
  7. For batch work, paste one title per line and process the whole list.

Worked examples

Ordinary article title

Input
How to Write Clean URLs in 2026!
Output
how-to-write-clean-urls-in-2026

Punctuation removed, spaces become hyphens, everything lowercased.

Title with accents and symbols

Input
Café au Lait & Crème Brûlée Recipe
Output
cafe-au-lait-creme-brulee-recipe

Accents folded to ASCII; ampersand and extra punctuation discarded.

Common mistakes and tips

  • Always preview the slug before saving; truncation can change meaning.
  • Prefer hyphens over underscores; search engines treat hyphens as word separators.
  • Do not include dates in the slug unless the date is part of the permanent identity.
  • If two titles collide, append a short unique token rather than changing the original wording.
  • Test the final URL in a browser to confirm the slug does not trigger unexpected redirects.

Frequently asked questions

Does the tool remove stop words like “the” or “and”?

No. It preserves every significant word so the slug remains a faithful, if simplified, representation of the original title. Removing stop words is an optional editorial choice you can make before pasting.

What happens with non-Latin scripts?

Characters that cannot be reasonably mapped to ASCII are dropped. The remaining Latin portions are slugified normally. For full Unicode slugs you would need a different, language-aware process.

Can I keep capital letters?

The tool always produces lowercase output. Uppercase letters are converted; mixed-case slugs are rarely desirable and can cause duplicate-content issues on case-sensitive servers.

Is the conversion reversible?

No. Information is deliberately discarded (punctuation, case, accents). Keep the original title if you need to reconstruct it later.

How does it handle very long titles?

When a length limit is set, the tool truncates at the last complete word that fits. It never splits a word in the middle and never leaves a trailing hyphen.