Skip to content

Slug Generator

Turn a title into a clean URL slug, with Vietnamese marks folded.

Runs entirely in your browser

Everything happens in this page. The title is never sent anywhere.

A slug is the readable part of a URL: the `dinh-dang-json` in `example.com/tools/dinh-dang-json`. It has to survive being typed, pasted into a chat window, printed on paper and read aloud over a phone, which rules out spaces, punctuation and anything that needs escaping.

More about Slug Generator

For Vietnamese that means folding the tone marks, and folding them properly. Unicode decomposition strips most Vietnamese accents cleanly, but it leaves `đ` alone: U+0111 is a letter of the alphabet in its own right rather than a `d` carrying a mark, so decomposition has nothing to remove. Without an explicit mapping it survives into the URL and gets percent-encoded, and `Đường Láng` becomes `%C4%91uong-lang` instead of `duong-lang`.

The alternative — leaving the accents in and letting the browser encode them — produces URLs that look fine in the address bar and turn into unreadable escapes the moment anybody copies one into an email. A slug exists precisely so that does not happen.

There are options for the separator, for case, for a length cap that cuts at a word boundary rather than mid-word, and for stop words. Stop words are worth using sparingly: dropping `the` and `of` shortens a slug, and dropping too much makes two different titles collide.

  • Vietnamese tone marks folded to plain letters, đ included
  • Punctuation removed and gaps collapsed to a single separator
  • Hyphen or underscore, and optional lowercasing
  • Length cap that cuts at a separator so no word is left half-written
  • Optional stop-word list for dropping the, a, of and similar
  • Digits kept, so a year or a version number survives

How to use it

  1. 1Type or paste the title.
  2. 2Read the slug underneath as it updates.
  3. 3Adjust the separator, case or length cap if you need to.
  4. 4Copy the slug with the button.

Questions

Why does đ need special handling?

Because U+0111 is its own letter, not a d with a mark, so Unicode decomposition leaves it untouched. Without an explicit mapping it survives into the URL as a percent-escape.

Should I keep the accents in the URL?

Usually not. They look fine in an address bar but turn into unreadable escapes the moment somebody copies the link into an email or a message.

What happens to numbers?

They are kept. A year, a version or a count in a title is often the most useful part of the slug.

Does the length cap cut words in half?

No. It cuts at the last separator inside the limit, so a truncated slug always ends on a whole word.

Should I use stop words?

Sparingly. Dropping the and of shortens a slug usefully, but dropping too many makes two different titles produce the same URL.

More Text Tools
Esc

16 results