🔗 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)中使用
- 计算结果仅供参考,请以实际应用场景为准