🔢 UUID 生成面板

点击"生成 UUID"开始...

📐 使用说明与演算示例

演算示例:UUID v4 结构 UUID v4 = xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
其中 x 为随机十六进制数字,y 为 8、9、a 或 b。
生成示例:
550e8400-e29b-41d4-a716-446655440000
6ba7b810-9dad-11d1-80b4-00c04fd430c8
* 本工具使用 crypto.randomUUID() 或等价安全的随机数生成器。

💡 什么是 UUID?

UUID(Universally Unique Identifier)是一种 128 位全局唯一标识符,通常表示为 32 个十六进制数字加 4 个连字符。它广泛用于数据库主键、分布式系统 ID、文件名、Session ID 等需要唯一性的场景。

💡 UUID v4 与其他版本有什么区别?

v4 基于随机数生成,不依赖时间戳或 MAC 地址,适合大多数通用场景。v1 基于时间戳和 MAC 地址,可排序但暴露信息。v7 是最新标准,基于 Unix 时间戳排序,适合数据库索引。

💡 UUID 是否可能重复?

理论上存在极低概率,但实践中几乎不可能。v4 有 122 位随机数,总数约 5.3×10^36。即使全球每秒生成 10 亿个 UUID,也需要约 10^19 年才会出现一次碰撞。

💡 如何在代码中生成 UUID?

现代浏览器和 Node.js 都支持 crypto.randomUUID()。Python 可使用 uuid.uuid4()。Java 使用 java.util.UUID.randomUUID()。本工具使用相同的标准算法,生成结果与代码调用一致。

🔢 UUID Panel

Click "Generate" to start...

📐 Notes & Examples

Example: UUID v4 Structure UUID v4 = xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
Where x is a random hex digit, and y is 8, 9, a, or b.
Sample output:
550e8400-e29b-41d4-a716-446655440000
6ba7b810-9dad-11d1-80b4-00c04fd430c8
* This tool uses crypto.randomUUID() or equivalent secure random generator.

💡 What is a UUID?

A UUID (Universally Unique Identifier) is a 128‑bit globally unique identifier, typically represented as 32 hex digits with 4 hyphens. It's used for database primary keys, distributed system IDs, filenames, session IDs, and any scenario requiring uniqueness.

💡 What's the difference between UUID versions?

v4 is random‑based, suitable for most general use. v1 is time‑ and MAC‑address‑based, sortable but reveals information. v7 is the newest standard, based on Unix timestamps, ideal for database indexing.

💡 Can UUIDs collide?

Theoretically possible but practically impossible. v4 has 122 random bits, totaling ~5.3×10^36 possibilities. Even generating 1 billion UUIDs per second globally, it would take ~10^19 years to see a single collision.

💡 How do I generate UUIDs in code?

Modern browsers and Node.js support crypto.randomUUID(). Python: uuid.uuid4(). Java: java.util.UUID.randomUUID(). This tool uses the same standard algorithm, producing identical results to code calls.