toolready. URL Slug Generator

URL Slug Generator

Title → clean URL slug. Strips Latin accents, lowercases, hyphen-joins.

What this does

Takes a human title and returns the version that belongs in a URL: lowercase, ASCII only, joined with a single separator, nothing at either end. It updates as you type, with three settings alongside — separator, case and maximum length. Everything is native string and regex work in your browser, so an unpublished headline stays private.

My Awesome Blog Post: A Café in São Paulo!

→  my-awesome-blog-post-a-cafe-in-sao-paulo

How do I turn a title into a slug?

  1. Paste the title into the top field.
  2. Adjust Separator (hyphen, underscore or dot), Case (lowercase or preserve) and Max length if the defaults don't suit.
  3. Hit Copy. Clear empties the field and refocuses it.

Which characters are stripped?

Everything outside A–Z, a–z and 0–9. Any unbroken run of other characters collapses into exactly one separator, so Rock & Roll — 50% off gives rock-roll-50-off rather than a string of stray hyphens. Leading and trailing separators are then trimmed, which means input like --hello world!! comes out clean. One consequence catches people out: apostrophes are separators too, so It's becomes it-s, not its. Delete apostrophes from the title first if you'd rather have the words joined.

How are accented characters transliterated?

Two stages. First the text is normalised to NFKD, which splits a composed letter such as é into a plain e plus a combining accent; the marks are then deleted, turning Café into Cafe and São into Sao. NFKD is the compatibility form, so it also unpacks ligatures and typographic variants: film→film, m²→m2, ½→1-2, full-width characters folding to ASCII. Second, a short table covers letters with no decomposition: ß→ss, æ→ae, œ→oe, ø→o, ð→d, þ→th, each with its uppercase form.

Why did my title come out empty or with letters missing?

Because transliteration only reaches as far as Latin. A Cyrillic, Greek, Arabic or CJK title has nothing to decompose to, so every character is dropped — Привет мир produces an empty slug, and 東京タワー guide keeps only guide. Stroked and barred Latin letters have the same problem: Ł, ı, đ and ħ aren't a base letter plus a mark, so Łódź gives odz. If you publish in a non-Latin script, either romanise the title yourself before pasting or let your CMS keep percent-encoded Unicode in the path — see URL encode and decode for what that looks like.

Hyphen or underscore?

Hyphen, for anything a search engine will index. Google has said for years that it reads a hyphen as a word separator and an underscore as a joiner, so blue_widgets can be read as one token while blue-widgets is clearly two. The underscore and dot options exist for this tool's other uses — filenames, storage keys, package identifiers, CSS class names — where the surrounding code sets the convention. For camelCase or CONSTANT_CASE instead, see the case converter.

How long should a slug be?

The default cap of 80 characters is a reasonable ceiling; most good slugs are three to six words. Truncation is a plain character cut applied after slugifying, followed by another trim of any separator left dangling — so it can end mid-word, as one two three four five six at 12 characters shows by producing one-two-thre. Check the result rather than assuming a clean break, and set max length to 0 to switch the limit off entirely. To see how many words you're working with before you trim, use the word counter.