twoodo
/

Home/Tools/Text & developer utilities

URL Slug Generator

Handles accented characters properly rather than dropping them.

What makes a good slug

A slug is the readable part of a URL that identifies a page. Good ones are lowercase, hyphenated, short and descriptive, and they contain no characters that need encoding.

Accents are transliterated, not deleted

This is where simple slug code fails. Stripping anything non-ASCII turns "café" into "caf" and "München" into "Mnchen". The right approach is to decompose accented characters into a base letter plus its accent, then discard the accent — giving "cafe" and "Munchen".

Characters with no decomposition need mapping by hand: ß becomes ss, æ becomes ae, ø becomes o. This page handles the common ones.

Hyphens, not underscores

Search engines have historically treated hyphens as word separators and underscores as joiners, so "my_great_post" could be read as one long token. The practical difference is now small, but hyphens remain the convention and there is no reason to fight it.

Stop words

Removing "a", "the", "of" and similar shortens a slug without losing much meaning. It is optional here because it sometimes changes the sense — "history-of-art" and "history-art" do not read the same, and "war-and-peace" becomes "war-peace".

Turn it on for long titles; leave it off for short ones.

Do not change a published slug

The URL is the identity of the page. Changing it breaks every existing link, every bookmark and every share, and search engines treat the new address as a new page with no history.

If it must change, set up a permanent redirect from the old address. And think twice before putting a year or a date in a slug, since that is the thing most likely to need changing later.

Common uses

  • Blog post and article URLs.
  • Product and category pages.
  • File names that need to be safe everywhere.
  • Anchor IDs for headings within a page.

Questions people ask

What is a URL slug?

The readable part of a URL that identifies a page — the 'how-to-make-coffee' in a blog address.

How should accented characters be handled?

Transliterated, not deleted. 'café' should become 'cafe', not 'caf'. Simple code that strips non-ASCII gets this wrong.

Hyphens or underscores?

Hyphens. Search engines have historically treated them as word separators and underscores as joiners, and hyphens remain the convention.

Should I remove stop words?

For long titles, often yes. Be careful where it changes the meaning — 'war-and-peace' becoming 'war-peace' reads differently.

Can I change a slug after publishing?

Only with a permanent redirect from the old address. Otherwise every existing link and bookmark breaks.

Your text stays in the page

This matters more here than on most tools. People paste API keys into hash generators, customer data into CSV converters, contract wording into diff checkers and configuration into JSON validators. Almost every site offering these sends your input to a server to process it.

Nothing here is transmitted. The work happens in your browser, this site is static files with no server behind it, and the about page lists every request the site makes, read live from your own browser so you can check rather than trust.