Text Tools

Slug Generator

Turn a title into a clean, URL-friendly slug.

Browser workspace
LOCAL PROCESSING

Input stays in this browser while you use the tool.

About this tool

The Slug Generator turns a title or a phrase into a slug: the short, readable part of a web address that identifies a page. In the address https://example.com/blog/remove-duplicate-lines, the slug is remove-duplicate-lines. A good slug describes the page in a few words, so that people and search engines can tell what it is about before they open it.

A slug has to be safe inside a URL. Letters, digits and a few symbols are always allowed, namely the hyphen, the dot, the underscore and the tilde. Everything else, such as spaces, ampersands, quotation marks and accented letters, must be written as percent codes. A space becomes %20 and an ampersand becomes %26, which makes an address long and ugly. A slug avoids that by using only plain characters.

To get there, the tool changes the text in a few steps: it converts the letters to lowercase, removes accents so that é becomes e, replaces spaces and punctuation with a hyphen, merges repeated hyphens into one and removes hyphens at the start and the end. The title Hello, World! becomes hello-world.

The tool works on the text that you give it. It does not know which slugs already exist on your site, so it cannot tell you that a slug is taken. It also cannot create redirects. The conversion runs in your browser, so your text is processed on your own device and is not sent to the BitToolsKit server.

Use cases

  • Blog posts and articles. Turn the headline into the last part of the post address, for example how-to-remove-duplicate-lines.
  • Product and category pages. Create consistent addresses for names that contain spaces, brand names with accents or symbols such as the ampersand.
  • Documentation and help pages. Build stable, readable paths for sections and headings.
  • HTML anchors and heading IDs. A slug is a convenient value for an id attribute, so that a link can jump to a section.
  • File and folder names. A name without spaces and special characters works on every system and in every command line.
  • Tags, usernames and handles. Make a clean identifier from a free-text label.
  • API paths and database keys. Use a readable key, such as a category name, in a path or a lookup field.
  • Check a title before you publish it. If the result is empty or looks strange, you know before the address goes live that the title needs a change.

How to use

  1. Type or paste your title into the Input box. Use the title as people would read it, with capital letters, spaces and punctuation.
  2. If the tool offers options, choose them now. Typical choices are the separator (a hyphen is the usual one), a maximum length and whether accents are removed.
  3. Click Run tool.
  4. Read the slug in the Output box. It should contain only lowercase letters, digits and hyphens, and it should still describe the page.
  5. Check that the slug is not already used on your site. If it is, add a word or a number to make it different.
  6. Click Copy output to copy the slug, Download to save it, or Clear to start again.

To check the length of your title before you convert it, use the Word Counter. To convert text between writing styles such as camelCase and kebab-case, use the Case Converter, which changes the style but does not remove accents or symbols. To see how a character is written inside an address, use the URL Encoder / Decoder.

Examples

Example 1: A simple title

Input:
Hello, World!
What a slug generator produces:
hello-world
The letters are lowercase, the comma and the exclamation mark are gone and the space became a hyphen.

Example 2: Extra spaces and hyphens

Input:
  Multiple   spaces   here  
Hello---World
What a slug generator produces:
multiple-spaces-here
hello-world
Spaces at the start and the end are removed, and repeated spaces or hyphens become one hyphen.

Example 3: A headline with an apostrophe

Input:
What is JSON? A Beginner's Guide
What a slug generator produces:
what-is-json-a-beginners-guide
Most tools delete the apostrophe. Some replace it with a hyphen and give what-is-json-a-beginner-s-guide, which is harder to read.

Example 4: Accented letters

Input:
Café Münster
Crème Brûlée
What a slug generator produces:
cafe-munster
creme-brulee
Accents are removed. A tool that follows the German convention may write cafe-muenster, with ue for ü.

Example 5: Letters that do not split into a base letter and an accent

Input:
Straße
Łódź
A tool with a transliteration table:
strasse
lodz

A simple tool that only strips accents:
stra-e
odz
The letters ß and Ł have no accent to remove, so the simple method drops them. Check the result for names that contain such letters.

Example 6: Symbols

Input:
Rock & Roll
C++ vs C#
50% off!
What a slug generator produces:
rock-roll (or rock-and-roll, if the tool replaces the ampersand)
c-vs-c
50-off
The symbols disappear, so C++ and C# both turn into a plain c. Write such titles in words if the difference matters.

Example 7: Dates and version numbers

Input:
2026-11-06 Release Notes (v2.0)
What a slug generator produces:
2026-11-06-release-notes-v2-0
The dot in v2.0 became a hyphen. Some tools keep dots, but a dot can make an address look like a file name.

Example 8: A title in Urdu

Input:
اردو سیکھیں
A tool that keeps only Latin letters and digits:
(empty)

A tool that keeps Unicode letters:
اردو-سیکھیں
In a browser address this is shown as readable text, but when you copy it, it becomes:
%D8%A7%D8%B1%D8%AF%D9%88-%D8%B3%DB%8C%DA%A9%DA%BE%DB%8C%DA%BA
The slug has 11 characters, and its encoded form has 61. For a Latin-script site, many people write a short English or transliterated slug by hand.

Example 9: A long title

Input:
How to Remove Duplicate Lines from a Text File on Linux Windows and macOS Quickly
The full slug has 81 characters:
how-to-remove-duplicate-lines-from-a-text-file-on-linux-windows-and-macos-quickly

Shortened to 40 characters at a word boundary:
how-to-remove-duplicate-lines-from-a

Cut at exactly 40 characters:
how-to-remove-duplicate-lines-from-a-tex
A cut in the middle of a word leaves a fragment. Better still, write a shorter slug by hand, such as remove-duplicate-lines.

Example 10: Titles that give the same slug

Input:
Hello World
hello world!
Hello, World
All three produce:
hello-world
Two pages cannot share one address. A website usually adds a number, as in hello-world-2 and hello-world-3. The tool does not know which slugs are already in use on your site.

Common errors

The slug is empty

The title contains only characters that the tool removes, for example Urdu, Arabic, Chinese or Cyrillic letters when the tool keeps only Latin letters and digits. Write a short slug by hand in Latin letters, or use a tool that keeps Unicode letters, and remember that those appear as long percent codes when copied.

Symbols disappear and the meaning is lost

Characters such as +, #, % and & are removed or replaced, so C++ and C# both become c. If the symbol carries the meaning, write it in words in the slug, for example cpp-vs-c-sharp.

Some letters are dropped, giving odd slugs like stra-e or odz

Removing accents works for letters that are a base letter plus a mark, such as é and ü. Letters like ß, Ł and Ø have no mark to remove, and a simple tool deletes them. Use a tool that transliterates them (ß becomes ss), or fix the slug by hand.

The slug was cut in the middle of a word

A hard maximum length can leave a fragment such as tex at the end. Shorten the slug yourself at a word boundary, and remove words that do not help, such as the, a and of.

A slug ends or starts with a hyphen

Punctuation at the edge of the title can leave a hyphen at the start or the end. A good generator removes them. If one remains, delete it, because an address that ends in a hyphen looks like a mistake.

Two pages ended up with the same slug

Different titles can give identical slugs, and the tool cannot see your existing pages. Check your site before you publish, and add a distinguishing word or a number.

Capital letters are kept in the slug

On many servers the path of a URL is case-sensitive, so /Hello-World and /hello-world can be different pages. Use lowercase only, and make sure links always use the same form.

Underscores are used instead of hyphens

Search engines read a hyphen as a word separator. Google's URL guidance recommends hyphens and advises against underscores, so write hello-world, not hello_world. Choose the underscore only when a system requires it.

The slug was changed after the page was published

Old links, bookmarks and search results still point to the old address and will end in an error page. If you must change a slug, set up a permanent redirect (301) from the old address to the new one.

The slug is very long or stuffed with words

A long slug is hard to read, to share and to remember. Keep it short and descriptive, with the main words of the title. A date or an ID in the slug is only useful if you need it, and it makes the address age badly.

Frequently asked questions

What is a slug?

A slug is the readable part of a URL that identifies one page, usually made from the title. In example.com/blog/remove-duplicate-lines, the slug is remove-duplicate-lines.

Should I use hyphens or underscores in a slug?

Use hyphens. Search engines treat a hyphen as a separator between words, and Google's URL guidance recommends hyphens over underscores. Write hello-world and not hello_world.

Should a slug be lowercase?

Yes. Paths are case-sensitive on many servers, so mixed capitals can create two different addresses for one page. Lowercase letters avoid the problem and are easier to type.

How long should a slug be?

There is no fixed limit, but shorter is better. A few words that describe the page, such as remove-duplicate-lines, are easier to read, share and remember than a copy of the whole title.

Should I remove words like the, a and of?

You can, when it keeps the slug short and the meaning clear. Do not remove words if the slug becomes confusing. Readability matters more than a fixed rule.

Can a slug contain letters from other alphabets?

Yes, modern browsers and search engines handle them, and the address is shown as readable text. When you copy or share it, the letters appear as long percent codes. In a test, an 11-character Urdu slug became 61 characters once encoded, so many sites prefer a short Latin-letter slug.

What characters are safe in a slug?

Lowercase letters, digits and hyphens are the safest choice. The characters that are always allowed in a URL are letters, digits and the symbols hyphen, dot, underscore and tilde. Anything else has to be percent-encoded.

Can I change a slug after publishing?

You can, but the old address will stop working unless you add a permanent redirect from the old slug to the new one. Change slugs only when there is a good reason.

Is a slug the same as kebab-case?

They look alike, but a slug is stricter. Kebab-case is a way of writing words with hyphens for code. A slug also has to be safe in a URL, so it drops accents, symbols and anything else that needs encoding.

Is my text uploaded to a server?

No. The tool runs in your browser and works on your device. As a general habit, avoid pasting passwords, API keys or private tokens into any online tool.

Related tools

Share this page