Slug Generator
Convert a headline into a readable, stable URL slug.
What makes a good slug
A slug is the human-readable part of a URL after the domain: /blog/json-parsing-tips. Three properties matter:
- Readable — both for people and for search snippets, where the URL is visible. Words separated by hyphens beat
?p=1284. - Stable — changing a slug breaks every existing link and any accumulated ranking. Decide it once, and redirect if you must change it.
- Plain ASCII — lowercase
a–z, digits and hyphens. No spaces, no uppercase, no punctuation, no percent-encoding.
Hyphens or underscores?
Google treats hyphens as word separators and underscores as word joiners, so json-formatter is read as two words while json_formatter is read as one. For URLs, use hyphens. Underscores are conventional in code identifiers — which is why this tool offers the choice.
Accents: transliterate or percent-encode?
Unicode URLs like /café-menü are technically valid and browsers display them nicely, but they get percent-encoded when copied, which looks like /caf%C3%A9-men%C3%BC in chat, in analytics and in logs. Decomposing accents (é → e) keeps the slug short and robust, at a small cost in exactness. For CJK titles there is no ASCII transliteration that is worth the ambiguity — keep the characters, or use an explicit id.
Length
Search engines display roughly 50–60 characters of a URL, and long slugs get truncated. Cutting at a word boundary — rather than mid-word — keeps the result legible. Sixty characters is a reasonable default ceiling.
Stop words: usually not worth it
Removing "the" and "and" makes slugs shorter, but it can also make them ungrammatical and less clear: /how-to-format-json reads better than /format-json. Modern ranking does not reward keyword-stuffed slugs, so prioritise clarity.