Slug Generator
テキストからURLスラッグを生成します。スペースや特殊文字を自動的に処理します。
入力テキスト
オプション
How to Use the Slug Generator
The Slug Generator is a free online tool designed to convert any text into a clean, URL-friendly slug suitable for web pages, blog posts, product URLs, and API endpoints. A slug is the part of a URL that identifies a specific page in a human-readable form, typically appearing after the domain name. For example, in the URL example.com/blog/how-to-use-git, the slug is "how-to-use-git". Creating proper slugs is essential for search engine optimization (SEO) because search engines use URL structure as a ranking signal, and clean URLs improve click-through rates in search results.
Why URL Slugs Matter for SEO
Search engines like Google analyze URL structure to understand page content. A well-crafted slug that contains relevant keywords can improve your page ranking for those terms. Clean, descriptive slugs also make URLs more shareable and trustworthy to users. Studies have shown that URLs containing relevant keywords receive higher click-through rates in search engine results pages (SERPs). Best practices for URL slugs include keeping them short (3-5 words), using hyphens as word separators (Google recommends hyphens over underscores), removing stop words like "the", "a", and "is", and using lowercase letters throughout. This tool automates these best practices for you.
Handling Special Characters and Non-ASCII Text
When generating slugs from text that contains special characters, punctuation, or non-ASCII characters (such as Japanese, Chinese, Korean, or accented Latin characters), this tool removes non-ASCII characters and replaces spaces and special characters with your chosen separator. While some content management systems support Unicode in URLs (known as Internationalized Resource Identifiers or IRIs), using ASCII-only slugs ensures maximum compatibility across all browsers, servers, and services. The tool warns you when non-ASCII characters are detected so you can provide appropriate English text for the slug if needed. All processing happens entirely in your browser with no data sent to any server, ensuring complete privacy.
Separator Choice: Hyphens vs Underscores
Google treats hyphens as word separators in URLs but treats underscores as word joiners. This means "web-development" is interpreted as two words, while "web_development" is treated as a single compound word. For SEO purposes, hyphens are generally recommended. However, some systems and APIs prefer underscores for technical reasons, so this tool offers both options.
Slug Generatorの使い方
このSlug Generatorは、テキストをURLに適したスラッグに変換する無料オンラインツールです。 スペースや特殊文字を自動的に処理し、SEOに最適化されたURLスラッグを生成します。 ハイフンとアンダースコアの選択、大文字小文字の変換オプションに対応しています。 日本語などの非ASCII文字が含まれる場合は警告を表示し、ASCII文字のみのスラッグを生成します。 全ての処理はブラウザ内で完結し、データが外部に送信されることはありません。
よくある落とし穴と対処 / Common Pitfalls
| 落とし穴 / Pitfall | 問題 / Problem | 対処 / Fix |
|---|---|---|
| 日本語タイトルが空スラッグになる Japanese titles yield empty slugs | 非ASCII除去型のスラッグ化では日本語が全て消える ASCII-only slugifiers strip all Japanese characters | 英訳タイトルかローマ字でスラッグを別途用意する(機械ローマ字化は読みの誤りが多い) Provide an English/romaji slug manually |
| 公開後にスラッグを変更 Changing slugs after publishing | 旧URLが404になり、被リンク・SNSシェア・検索評価を失う Old URLs 404 and lose link equity | 変更が必要なら301リダイレクトを必ず設定 Always 301-redirect old slugs |
| 連続ハイフン・先頭末尾ハイフン Doubled or leading/trailing hyphens | 「A & B」→ a--b、「 (注) 」→ -注- のような不格好なURL Symbols collapse into ugly hyphen runs | 連続ハイフンを1つに圧縮し、両端をトリム(本ツールは処理済み) Collapse and trim hyphens (this tool does) |
| 大文字混在による重複URL Case-sensitive duplicate URLs | /Blog/Post と /blog/post が別ページ扱いされ評価が分散 Mixed-case paths split ranking signals | スラッグは小文字に統一し、canonical を設定 Lowercase everything; set canonicals |
| ストップワード除去のし過ぎ Over-stripping stop words | 「how-to-fix」の to を消すと意味が変わることがある Removing stop words can change meaning | 可読性優先。3〜5語程度の意味が通るスラッグにする Favor readable 3-5 word slugs |
コード例 / Code Examples
JavaScript
const slugify = (s) => s
.toLowerCase()
.normalize("NFKD") // アクセント分解(é→e+´)
.replace(/[\u0300-\u036f]/g, "") // 結合記号を除去
.replace(/[^a-z0-9]+/g, "-") // 英数以外をハイフンに
.replace(/^-+|-+$/g, ""); // 両端のハイフン除去
slugify("Hello, World! 2026") // "hello-world-2026"Python (django.utils.text)
from django.utils.text import slugify
slugify("Hello, World! 2026") # 'hello-world-2026'変換例 / Before & After
"10 Tips for Better SEO (2026)" → "10-tips-for-better-seo-2026"
"Café & Restaurant Guide" → "cafe-restaurant-guide"
"Next.js 16の新機能まとめ" → "nextjs-16" + 英語スラッグ推奨
(例: "nextjs-16-new-features")Why browser-only?
Slugs come from titles of content you have not published yet. This generator transforms them entirely in your browser — your upcoming article titles are never sent anywhere, nothing is logged, and the tool works offline. Verify in the DevTools Network tab: zero requests.
スラッグ化するのは未公開記事のタイトル。本ツールは変換がブラウザ内で完結し、 外部送信は一切ありません。URL全体のエンコードはURL Encoderをどうぞ。
関連ツール / Related Tools
開発をもっと効率的に
PR
レンタルサーバー
エックスサーバー
国内シェアNo.1の高速レンタルサーバー(エックスサーバー社調べ)。WordPressも簡単セットアップ。
詳しく見る →レンタルサーバー
ConoHa WING
国内最速クラスのレンタルサーバー。独自ドメイン永久無料特典付き(特典内容は変更される場合があります)。
詳しく見る →レンタルサーバー
mixhost
高速SSD・HTTP/3対応のクラウド型レンタルサーバー。
詳しく見る →VPS
シンVPS
メモリ単価国内最安・オールNVMe SSD搭載の高性能VPS。開発・検証環境の構築に。
詳しく見る →Windows VPS
ConoHa for Windows Server
Windows環境のVPS。リモートデスクトップで開発・検証環境を構築。
詳しく見る →