OnlineTextLab
Esc

URL Slug Generator

Paste titles and get clean URL slugs, with accents converted, punctuation handled and any length limit applied at a word boundary.

Separator

Ctrl or Cmd + Enter copies the result.

Runs on your device. Your files and text are not uploaded.

About Slug Generator

A slug is the readable part of a URL, such as how-to-bake-bread at the end of an address. Paste a page title and the slug appears as you type, in lowercase with hyphens, and with accents and punctuation dealt with. Paste a list with one title per line and you get a list back, which is quicker than doing them one at a time when you are moving a whole blog.

The details are where slugs go wrong. Crème Brûlée should become creme-brulee and not crme-brle. Node.js should be node-js and not nodejs, and What's should be whats and not what-s. Straße needs to become strasse, a letter that the usual accent-stripping approach loses.

You can use underscores in place of hyphens, drop small words such as the and of, or set a maximum length, which cuts at the last whole word that fits. For text in other scripts, there is an option to keep the letters as written.

How it works

Each line is handled separately, with blank lines skipped. Text is lowercased and decomposed using Unicode normalization (NFD), which splits é into e plus an accent mark, and the mark is removed. Letters that do not decompose, such as ß, æ, ø and ł, are converted by a table to ss, ae, o and l. An ampersand becomes and.

Apostrophes are then deleted so that don't stays one word. Anything else that is not a letter or digit acts as a word break, including dots, slashes, underscores and dashes. The words that are left are joined with your separator, which also means a slug never starts or ends with one, or has two in a row.

With a length limit, words are added until the next would pass it, so the slug does not end on half a word. A single word longer than the limit is cut. With Keep non-Latin letters on, the accent stripping is skipped and letters from any script stay, normalized to their composed form (NFC).

How to use Slug Generator

  1. Paste titles into the Titles or headings box, one per line. Try an example loads three that show the tricky cases.
  2. Choose Hyphen or Underscore under Separator.
  3. Enter a number in Longest slug if you have a limit.
  4. Turn on Drop small words or Keep non-Latin letters if you need them.
  5. Copy the slugs with Copy, or Ctrl or Cmd + Enter. Download saves them as slugs.txt.

Three titles with common problems

Input
10 Tips for Crème Brûlée & Other Desserts!
What's new in Node.js 22?
Die Straße: A Guide
Output
10-tips-for-creme-brulee-and-other-desserts
whats-new-in-node-js-22
die-strasse-a-guide

With Drop small words on, The Art of War: A Short History becomes art-war-short-history. The stats line shows the number of slugs and the length of the longest.

When it helps

  • Creating the URL for a new article or product page from its title.
  • Generating slugs in bulk when migrating a blog or a product catalog to a new platform.
  • Making file names that are safe across operating systems, with no spaces or special characters.
  • Creating anchor IDs for headings in a long document.

Tips for a better result

  • Keep hyphens for URLs. Google's own guidance recommends hyphens over underscores to separate words in a URL.
  • Do not change a published slug without adding a redirect from the old address, or existing links and search rankings will break.
  • Shorter usually reads better. Aim for the handful of words that describe the page, and use Drop small words as a starting point.
  • German writers often prefer ue for ü. This tool produces u, so fix those words by hand if your style calls for it.

Good to know

  • Without Keep non-Latin letters, text in Chinese, Arabic, Cyrillic and other scripts disappears, since the tool has no transliteration. The page warns you when that happens, and for proper romanization a dedicated tool for that language is the better choice.
  • With Keep non-Latin letters on, browsers may display the URL percent-encoded when it is copied, and some older systems handle those addresses poorly.
  • It does not check whether a slug is already in use on your site, or strip words for search purposes beyond the small-word list.

Questions people ask

Should a URL slug use hyphens or underscores?

Hyphens, in almost all cases. Search engines read a hyphen as a word break, while word_word can read as a single unit. Underscores make sense mainly for file names or a system that requires them.

How long should a slug be?

There is no fixed rule, and the technical limit is far beyond what you would use. Three to six meaningful words is a sensible target, so the URL stays readable when shared. The Longest slug option helps you hold to a limit across a whole list.

What happens to a title in Japanese or Arabic?

By default the letters are removed, and the page tells you that nothing usable was left. Turn on Keep non-Latin letters to keep them, which gives 日本語-タイトル, a valid address in modern browsers. Many sites prefer a short English slug for such pages.

What to use next

Last reviewed . Read our editorial policy.