Developer tools

Slug Generator

Turn any title, phrase, or page name into a clean, SEO-friendly URL slug instantly.

Convert spaces, symbols, accents, and unnecessary words into a readable lowercase URL structure — directly in your browser.

Your text is processed locally in your browser and is not uploaded to LiveTechHacks.

Enter a Title or Text

Generated Slug

Enter a title or phrase to generate a slug.

URL Preview

This is a sample address only. It does not create or check a live page.

https://example.com/

Slug details

  • Slug length: 0 characters
  • Words: 0

Add some text to generate a slug.

Slug Options

Hyphens are the default. Stop words stay in unless you turn removal on.

Separator

Most public URLs are easier to read in lowercase.

Off by default so words like “for” and “to” can stay when they help meaning.

Leave numbers in when a year or ranked list is part of the topic.

Latin accents are always folded (café → cafe). This option keeps A–Z and 0–9 only. It does not romanize Arabic, Chinese, or similar scripts.

A convenience limit, not a ranking rule. Truncation prefers whole words.

Optional brand names or acronyms, separated by commas. These skip stop-word removal and keep the capitalization you enter.

Generate a Random Slug

For placeholder URLs, demos, and test routes — not for passwords, API keys, or security-sensitive IDs.

What Is a URL Slug?

A slug is the readable path segment that commonly identifies a page. It is a URL-friendly string, usually in kebab-case: lowercase words separated by hyphens.

In https://example.com/blog/seo-friendly-url, the slug is seo-friendly-url. The domain, directories, and slug together form the path. A permalink is the lasting address for that page. Not every site uses a single slug in the same way — some apps use IDs, dates, or nested folders.

What Makes a Good SEO-Friendly URL Slug?

A useful slug describes the page in words a person can read. Keep it relevant, concise, and free of leftover punctuation. Lowercase hyphenated text is the usual web pattern because it is easy to scan and share.

The slug should help someone understand the topic before they click. Search engines can work with many URL shapes; clarity for users still comes first. This page is an online slug generator for that job, not a ranking scorecard.

How to Generate a URL Slug

  1. Enter a page title or phrase.
  2. Choose your separator and any optional settings.
  3. Review the generated slug.
  4. Copy the result.
  5. Add it to your CMS, framework, or routing system.

Convert a Page Title to a URL Slug

Paste a heading into this title to slug generator when you want a clean path before you publish. For example, How to Improve Website Speed in 2026 becomes how-to-improve-website-speed-in-2026.

Automatic conversion is handy for blog posts, landing pages, documentation, product pages, and CMS entries where the title is already written and the permalink still needs a tidy slug.

Should URL Slugs Use Hyphens or Underscores?

Hyphens are the usual choice for public pages because they visually separate words. Underscores are valid in URLs and can still be used in files or internal routes. This tool defaults to hyphens and lets you switch to underscores when a framework expects them.

Should You Remove Stop Words From a Slug?

Stop words include short words such as the, and, of, to, and in. Removing them can shorten a URL. They should not be stripped automatically when they keep the phrase readable.

That is why stop-word removal is off by default here. Turn it on only when the shorter slug still matches the page topic.

How Long Should a URL Slug Be?

There is no single character count that search engines require. Shorter URLs are often easier to read, paste, and share. Extra words can usually go if they do not add meaning. The slug should still describe the page.

The optional length control is a convenience for CMS limits or house style. It is not presented as a ranking rule.

Slug Generator for WordPress

WordPress builds a post or page slug from the title, and you can edit it before publishing. The WordPress permalink structure then combines that slug with your chosen permalink settings, such as a /blog/ prefix.

Use this tool to prepare the slug first, then paste it into WordPress. LiveTechHacks does not connect to your WordPress site.

How to Generate Slugs in JavaScript, PHP, and Laravel

Slug generator in JavaScript

A small slugify helper can lowercase text, strip diacritics with Unicode normalization, drop leftover symbols, and join words with hyphens. The snippet below is a starting point for ASCII-oriented slugs. The on-page tool also offers stop-word removal, length limits, and optional Unicode letters.

function slugify(text) {
  return text
    .normalize("NFD")
    .replace(/[\u0300-\u036f]/g, "")
    .toLowerCase()
    .trim()
    .replace(/[^a-z0-9\s-]/g, "")
    .replace(/\s+/g, "-")
    .replace(/-+/g, "-")
    .replace(/^-|-$/g, "");
}

Slug generator in PHP

PHP can follow the same idea with strtolower, a regular expression, and hyphen replacement. Simple regex is not fully internationalized. For non-Latin input, use Transliterator, iconv, or a maintained library rather than assuming every script folds to ASCII.

$slug = strtolower(trim($title));
$slug = preg_replace('/[^a-z0-9\s-]/', '', $slug);
$slug = preg_replace('/[\s-]+/', '-', $slug);

Slug generator in Laravel

Laravel includes Str::slug(), which is the usual helper for this job in that framework.

use Illuminate\Support\Str;

$slug = Str::slug('My Example Blog Post');
// my-example-blog-post

Slug Generator FAQs

What is a slug generator?

A slug generator converts a title or phrase into a URL-friendly string. It typically lowercases the text, replaces spaces with hyphens, and removes characters that do not belong in a path segment.

What is a URL slug?

A slug is the readable part of a path that usually identifies a page. In https://example.com/blog/seo-friendly-url, the slug is seo-friendly-url. The rest of the address is the domain and any directories around it.

How do I make a URL slug SEO-friendly?

Keep it descriptive, readable, and relevant to the page. Lowercase text and hyphens are the usual pattern. Avoid extra symbols and words that do not help someone understand the topic.

Should URL slugs use hyphens or underscores?

Hyphens are the common choice for public web URLs because they are easy to read and are treated as word separators. Underscores can still work, but this tool defaults to hyphens for that reason.

Should I remove stop words from my URL?

Only when the shorter version stays clear. Words such as the, and, and of can sometimes be dropped, but they also help readability. This generator leaves stop words in unless you turn the option on.

Can a slug contain numbers?

Yes. Numbers are useful when they are part of the topic, such as a year or a ranked list. You can strip numbers in the options if you want a purely lexical slug.

What is the difference between a slug and a permalink?

The slug is the page identifier. A permalink is the full lasting URL, which can include the domain, folders, the slug, and sometimes other path parts.

Can I change a slug after publishing?

You can, but changing a published slug changes the URL. Add a redirect from the old address and update internal links so existing bookmarks and search results still resolve.

Related Developer & SEO Tools

Other LiveTechHacks utilities that also run in your browser.

JWT Decoder

Decode JWT tokens instantly and inspect the header, payload, claims, signature details, and expiration time in a readable format.

Open Tool

Passphrase Generator

Generate strong, memorable passphrases from the EFF diceware wordlist. Pick your word count and separator. Runs offline — nothing is ever transmitted.

Open Tool

Cron Expression Generator

Build cron expressions visually and preview the next run times instantly. Supports standard crontab, Quartz, Spring and AWS syntax. Free, with no sign-up.

Open Tool

YAML ↔ JSON Converter

Convert YAML to JSON and JSON to YAML instantly, with validation and error highlighting. Works with Kubernetes, OpenAPI and Docker Compose files.

Open Tool

UUID Generator

Generate random UUID v4, v1 and v7 identifiers in bulk, up to 1,000 at a time. Copy or download instantly in your browser.

Open Tool

Epoch Converter

Convert Unix timestamps to readable dates and back, in seconds or milliseconds. Live clock, timezones, and code snippets.

Open Tool

Base64 Encoder & Decoder

Encode and decode Base64 strings, files and images instantly. Supports base64url and data URIs in your browser.

Open Tool