ToolsForWeb

Saved

Tap ☆ on any tool to keep it here.

toolsforweb

Slugify

Turn any title into a clean, URL-safe slug.

Runs in your browser — nothing is uploaded

Loading tool…

Results are provided as is, for general information. Check anything important before relying on it. See the Terms of Use.

About this tool

Turn a title or phrase into a slug for a URL, filename or anchor. The text is Unicode-normalised and combining accents are stripped (é becomes e, ü becomes u), & is expanded to 'and', then every run of characters outside a–z, 0–9 becomes a single separator, with leading and trailing separators trimmed. Output is lowercased unless you turn that off, and an optional maximum length trims the slug back to a whole word where it can — but a single word longer than the limit is cut at that length. The separator can be a hyphen or an underscore.

When to use it

Generating the URL segment for a blog post, docs page or product from its title.
Producing a safe filename from a heading or document title.
Creating stable anchor ids for section links.
Normalising user-supplied names into keys for a slug column.

Questions

Why does a title in Cyrillic, Greek or Chinese come out empty?

Diacritic stripping only removes accents from Latin letters that Unicode can decompose. It does not romanize other scripts, so 'Привет' has no a–z characters left and the slug is empty. Add a Latin transliteration of the title yourself, or keep a separate manually chosen slug for those.

What happens to & and other symbols?

& becomes the word 'and' ('C++ & C#' → 'c-and-c'), which is the common convention for readable slugs. Every other symbol or space collapses to a single separator, so '+' and '#' simply disappear here.

How does the maximum length work?

The slug is cut to the limit and then trimmed back to the last separator, so 'one two three four' with a limit of 10 gives 'one-two', not 'one-two-th'. If there is no separator within the limit — a single word longer than the limit — the slug is cut at that length, so 'supercalifragilistic' with a limit of 5 gives 'super'.

Can I keep uppercase letters?

Yes — turn off the lowercase option and 'Hello World' becomes 'Hello-World'. Most URL routing is case-sensitive, so lowercase is the safer default.

Why does a title in another script produce an empty slug?

The tool strips accents from Latin letters and keeps a–z, 0–9; it does not transliterate any other script, so Cyrillic, Greek, Arabic or Chinese input has no eligible characters left and yields empty. Write the Latin transliteration (or a translation) yourself — a formatter that silently chose between rival romanizations would guess wrong about names more often than not.

What happens to numbers at the start?

They are kept: '10 Tips & Tricks' becomes '10-tips-and-tricks'. A leading digit is valid in URLs and filenames, so nothing is special-cased away; if some downstream identifier forbids leading digits, that is that system's rule to apply, not the slug's. Slugs exist to be spoken, typed and guessed — digits rarely hurt and often help ('top-10', '2026-review').

How does the maximum length trim?

Back to the last separator within the limit, so 'one two three four' at 10 gives 'one-two' — never a half-word like 'one-two-th'. Only a single word longer than the limit gets hard-cut at the limit, since there is no interior boundary to respect. If the trimmed slug would end on a meaningless fragment, rewrite the title rather than nudging the limit until it happens to fit.

Can the slug keep uppercase letters?

Yes — switch the lowercase option off and 'Café Culture' becomes 'Cafe-Culture'. The default exists for a reason: most servers treat the path as case-sensitive, so a link typed with the wrong case 404s — an all-lowercase slug makes that mistake impossible. Keep capitals only when a specific system you feed expects CamelCase slugs.

Why does '&' become 'and'?

The ampersand is a word in running prose — 'R&D', 'coffee & tea' — and a bare symbol is unpronounceable in a URL you read aloud; expanding to 'and' is the web-wide convention. Every other symbol outside letters, digits and separators collapses into a single separator and disappears: '#4!!' leaves only '4' behind. The result is a slug you can say over the phone and have typed back correctly.

Why does my double space not produce a double separator?

Runs of non-allowed characters collapse to exactly one separator: 'coffee & tea' yields 'coffee-and-tea', never '--' or '__'. The same rule makes emoji, smart quotes and stray punctuation vanish without leaving separators between them. The output stays clean even when the input is an untidied paste from a formatted source.

Related tools