首页Home › 开发工具Developer Tools

🆔 ULID 生成器ULID Generator

生成 ULID(通用唯一字典序排序标识符):26 个字符的 Crockford Base32,前 48 位是毫秒时间戳、后 80 位是随机数,比 UUID 更短且可按时间排序。可一次生成多个、启用同一毫秒内单调递增、小写输出,并显示每个 ULID 的时间戳。随机数由 crypto 生成,全部在本地完成。Generate ULIDs (Universally Unique Lexicographically Sortable Identifiers) — 26-character Crockford Base32 with a 48-bit millisecond timestamp followed by 80 random bits, shorter than a UUID and sortable by time. Make several at once, enable monotonic ordering within the same millisecond, output lowercase, and see each ULID's timestamp. Randomness comes from crypto, entirely locally.

使用说明与常见问题How-to & FAQ

「ULID 生成器」是什么?What is the ULID Generator tool?

生成 ULID(通用唯一字典序排序标识符):26 个字符的 Crockford Base32,前 48 位是毫秒时间戳、后 80 位是随机数,比 UUID 更短且可按时间排序。可一次生成多个、启用同一毫秒内单调递增、小写输出,并显示每个 ULID 的时间戳。随机数由 crypto 生成,全部在本地完成。Generate ULIDs (Universally Unique Lexicographically Sortable Identifiers) — 26-character Crockford Base32 with a 48-bit millisecond timestamp followed by 80 random bits, shorter than a UUID and sortable by time. Make several at once, enable monotonic ordering within the same millisecond, output lowercase, and see each ULID's timestamp. Randomness comes from crypto, entirely locally.

如何使用「ULID 生成器」?How do I use the ULID Generator tool?

在「ULID 生成器」中,按需设置「数量」等选项,然后点击「生成」、「复制」按钮即可。In the ULID Generator: Set "Count", then click "Generate", "Copy".

ULID 和 UUID 有什么区别?How does a ULID differ from a UUID?

ULID 是 26 个字符(128 位),比 UUID 的 36 个字符更短,用 Crockford Base32 编码(不含 I、L、O、U,避免混淆)。它的前 48 位是毫秒时间戳,所以按字典序排序就等于按生成时间排序,适合做数据库主键;UUID(如 v4)完全随机、不可排序。A ULID is 26 characters (128 bits), shorter than a UUID's 36, encoded in Crockford Base32 (no I, L, O or U, to avoid confusion). Its first 48 bits are a millisecond timestamp, so sorting ULIDs lexicographically also sorts them by creation time, which suits database keys; a UUID (such as v4) is fully random and not sortable.

“单调递增”是做什么的?What does Monotonic do?

同一毫秒内生成多个 ULID 时,若时间戳相同,单调模式会把随机部分加 1,保证后生成的 ULID 严格大于前一个,排序稳定;关闭后同一毫秒内的顺序只能靠随机数,可能不单调。When several ULIDs are generated in the same millisecond, monotonic mode increments the random part by 1 so each new ULID is strictly greater than the last, keeping the order stable; with it off, ties within a millisecond rely on randomness and may not be ordered.

时间戳用的是哪个时区?Which time zone is the timestamp?

ULID 内部存的是 UTC 毫秒数(Unix 时间)。勾选“显示时间戳”时,这里按 ISO 8601 的 UTC(以 Z 结尾)显示,与时区无关。A ULID stores UTC milliseconds (Unix time). With Show timestamp ticked, it is displayed as ISO 8601 UTC (ending in Z), independent of your time zone.

随机部分安全吗?Is the random part secure?

80 位随机数由浏览器的 crypto.getRandomValues 生成,碰撞概率极低;但 ULID 的前半部分暴露了生成时间,若不希望泄露时间请改用随机 UUID。The 80 random bits come from the browser's crypto.getRandomValues, so collisions are extremely unlikely; however a ULID reveals its creation time in the first half, so use a random UUID instead if the time must stay private.

代码或数据会被上传吗?Is my code or data uploaded?

不会。「ULID 生成器」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The ULID Generator runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.

「ULID 生成器」免费吗?需要注册吗?Is the ULID Generator free? Do I need an account?

「ULID 生成器」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The ULID Generator is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.

相关工具Related tools

💬 WhatsApp 链接生成器(点击直达聊天)WhatsApp Link Generator (click-to-chat)✉️ 邮件签名生成器(HTML)Email Signature Generator🎨 CSS 校验器(CSS 语法检查)CSS Validator🟨 JavaScript 校验器(JS 语法检查)JavaScript Validator🧾 JSON 格式化校验JSON Formatter & Validator🧪 正则表达式测试Regex Tester⏰ Cron 表达式解析Cron Expression Explainer🔀 YAML JSON 互转YAML to JSON Converter📊 CSV JSON 互转CSV to JSON ConverterⓂ️ Markdown 在线预览Markdown Live Preview🗄️ SQL 格式化/压缩SQL Formatter & Minifier🧵 字符串转义/反转义String Escape / Unescape

← 全部工具All tools