🔗 Text to URL Slug
選項
📋 Slug 結果
請輸入文本...
📚 深度解析:文字轉 Slug
💡 常見使用場景
- URL 友好化:把標題轉成小寫、連字元分隔的 slug,用於文章/商品連結。
- 檔名規範化:把含空格中文的名字轉成安全檔名或目錄。
- SEO 與可讀性:生成人類可讀且無亂碼的永久連結。
Hello World 轉 slug
輸入「Hello World!」,轉得「hello-world」,去除標點、轉小寫、空格變連字元;用於 /posts/hello-world 這類乾淨 URL。
❓ 常見問題(FAQ)
- 中文怎麼處理?
- 需轉拼音再連字元(如「教程」→「jiao-cheng」),否則直接去非 ASCII 會丟語義;是否轉拼音看工具選項,純去非 ASCII 會清空中文。
- 連續連字元會合並嗎?
- 會。多個空格/標點產生的連續「-」會摺疊為單個,避免「hello--world」這類醜 slug。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Allowed characters | slugs keep unreserved characters only and map spaces to hyphens | RFC 3986, URI generic syntax |
| Accent handling | accented letters are stripped before transliteration or percent encoded | Unicode UAX #15, normalisation forms |
| Confusable risk | distinct titles may collapse to one slug so a unique suffix avoids collision | Unicode UTS #39, security mechanisms |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準