UUID Generator · UUID 生成器

Generate unique identifiers for databases, APIs and test data — version 4 random or version 1 time-based, one or a hundred at a time. 为数据库、接口和测试数据生成唯一标识:v4 随机版或 v1 时间版,一次一个或一百个。

Generate 生成 UUID

Version 4 is random; version 1 embeds the current time, so later UUIDs sort after earlier ones. v4 是纯随机的;v1 包含当前时间,生成时间越晚排序越靠后。

Version 版本
Format 格式
1–100 at a time. 一次最多 100 个。

    Check a UUID 检查 UUID

    Paste any UUID to see whether it is valid, which version it is, and — for version 1 — what time it was made. 粘贴任意 UUID,查看它是否有效、是哪个版本,v1 还会显示它生成的时间。

    How to use 使用方法

    1. Generate: pick version 4 or version 1, choose how many, press Generate — every UUID on the list has its own Copy button, or copy them all at once. 选 v4 或 v1、选数量,点「生成」,每条都有单独的复制按钮,也可以一次全复制。
    2. Format: uppercase, no hyphens, or braces — the options apply to the next batch you generate. 格式选项(大写、去短横线、加花括号)对下一批生成结果生效。
    3. Check: paste a UUID into the lower box to see its version and variant, and the creation time for version 1. 下面的框里粘贴 UUID,可以查看版本、变体,v1 还能看到生成时间。

    FAQ 常见问题

    What is a UUID? 什么是 UUID?

    Universally Unique Identifier — a 128-bit value written as 32 hexadecimal digits in five groups (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). It is used as a database key, a request ID or a filename because the chance of two of them colliding is practically zero. 通用唯一标识符:128 位的值,写成 32 位十六进制,分五组。它常被用作数据库主键、请求 ID 或文件名,因为两个 UUID 碰撞的概率几乎为零。

    Version 4 or version 1 — which one? v4 和 v1 该选哪个?

    Version 4 is purely random — the usual choice for IDs. Version 1 embeds the creation time plus a node identifier, so UUIDs made later sort after earlier ones; it is useful when you want IDs that are both unique and roughly ordered. v4 是纯随机,作 ID 的常规选择。v1 包含生成时间和节点标识,生成时间越晚排序越靠后,适合既要唯一、又希望大致有序的场景。

    How unique is a version 4 UUID, really? v4 到底有多唯一?

    It has 122 random bits, so there are about 5 × 1036 possible values. Generating a billion UUIDs a second, you would need about 85 years to have even a 50% chance of one collision. v4 有 122 位随机位,约 5 × 1036 种可能:即使每秒生成十亿个,也要大约 85 年才有 50% 的概率撞上一次。

    Is anything uploaded? 我的数据会被上传吗?

    No. Every UUID is generated in JavaScript on this page, in your browser, using your device's cryptographic random source. Nothing you type or generate is sent anywhere. 不会。所有 UUID 都在本页面的 JavaScript 里、你的浏览器中生成,使用设备自带的密码学随机源,输入和生成的内容不会发送到任何地方。