webtools

Text to Slug

Private: nothing leaves your browser

Slugs
output

                  

Waiting for text

Turn a headline into a clean URL slug: lowercase, accents flattened, punctuation gone and the words joined with hyphens. Paste a whole list of titles and you get one slug per line. A length limit cuts on a word boundary, never mid word.

About URL slugs

A slug is the readable part at the end of a URL: the how-to-bake-a-cake in example.com/blog/how-to-bake-a-cake. A good one is lowercase, uses only letters, digits and hyphens, and says what the page is about. That is partly for search engines, which read the words in a URL, and mostly for people, who can tell what a link leads to before they click it and can read it out over the phone without spelling anything.

Accents are handled by decomposing each letter into its base plus its accent mark and then dropping the mark, so "Café de Flore" becomes "cafe-de-flore" rather than losing the letter entirely or emitting a percent escaped mess. That works for every accented Latin letter rather than for a short list someone remembered to include.

The length limit cuts on a word boundary. Truncating at exactly 40 characters would leave you "how-to-bake-a-chocol", which reads badly and looks broken, so the slug backs up to the last complete word instead. Many content systems put a limit on the slug field, and a slug over roughly 60 characters is being clipped in the search result anyway, next to the title and description you can draft in the meta tag generator.

How to turn a title into a URL slug

  1. Paste your headline into the left box, or a list of titles with one per line.
  2. The slug appears on the right as you type, one per line.
  3. Pick Separator if your system wants underscores rather than hyphens.
  4. Set a Max length to cap the slug. It backs up to a whole word.
  5. Tick Keep capitals only if your platform is case sensitive about paths.
  6. Press Copy to take the result.

Common questions about URL slugs

Should a slug use hyphens or underscores?

Hyphens, for a public URL. Google has said for years that it reads a hyphen as a word separator and an underscore as a joiner, so red-shoes is two words and red_shoes is one. Underscores are the right choice for filenames, database columns and anywhere the value is also an identifier in code.

What happens to accented letters and emoji?

Accented Latin letters lose the accent and keep the letter, so "Café" becomes "cafe" and "Über" becomes "uber". Emoji, punctuation and symbols have no letter underneath and are dropped, collapsing into a single separator. A title written entirely in a non-Latin script has nothing left to keep, so the status line tells you rather than handing you an empty slug.

Can I convert a whole list of titles at once?

Yes. Paste one title per line and you get one slug per line, in the same order, ready to paste into a spreadsheet column or a migration script. Lines that produce nothing usable are left out rather than appearing as blanks, and the status line counts them.

How long should a slug be?

Three to six words is the usual advice, which lands around 40 to 60 characters. Long enough to say what the page is, short enough to survive being shown in a search result or pasted into a chat. Drop filler words like "a", "the" and "and" by editing the title before you convert it: the slug does not have to match the headline word for word.

Will changing a slug break my existing links?

Yes, unless you add a redirect. Any link, bookmark or search result pointing at the old URL will hit a 404. If a page is already published and getting traffic, set up a 301 redirect from the old slug to the new one at the same time as you rename it, and the ranking follows the page across.

Are the headlines I paste in kept anywhere?

No. The conversion is JavaScript running on this page, so unpublished headlines and draft titles stay on your own device. Nothing is sent, logged or saved, and the page keeps working with your connection switched off.

Next

Related tools

All Text tools