UUID v4 Generator|UUID v4 生成器

UUID v4 生成器 | UUID v4 Generator

UUID v4 生成器 UUID v4 Generator

生成符合 RFC 4122 的随机 UUID v4(本地生成,不上传任何数据),可用于:数据库主键、幂等键(Idempotency Key)、测试数据、追踪号等。
Generate RFC 4122 compliant random UUID v4 locally (no upload). Useful for DB primary keys, idempotency keys, test fixtures, tracking IDs, and more.

1. 输入参数 · Generator Options
建议一次生成 1–500 条便于复制与管理;上限默认 5000,避免浏览器卡顿。
Recommended 1–500 per batch for easy copy & manage. Max default 5000 to avoid browser lag.
UUID 规范对大小写不敏感(十六进制字符),但某些系统/日志习惯使用大写。
UUID is case-insensitive (hex). Some systems/logs prefer uppercase for readability.
标准形式通常为:xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx。去掉连字符更紧凑,但可读性下降。
Standard form: xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx. Removing hyphens is more compact but less readable.
每行一个:适合名单、批量导入。
逗号分隔:适合 SQL IN (…)、配置项。
JSON 数组:适合脚本与接口测试。
One-per-line for imports; comma-separated for SQL/config; JSON array for scripting & API testing.
3. 使用说明 · Notes
  • 什么是 UUID v4?· What is UUID v4?
    UUID(Universally Unique Identifier)是一种 128 位标识符。v4 表示“随机型 UUID”,主要由随机数生成。标准形式一般写成 8-4-4-4-12 的十六进制字符串。
    A UUID is a 128-bit identifier. Version 4 is “random-based”, generated primarily from random numbers, commonly displayed as a 8-4-4-4-12 hex string.
  • RFC 4122 合规点 · RFC 4122 compliance checklist
    本工具会在生成后强制设置:
    ① 版本号(version)为 4:第 13 个十六进制字符固定为 4
    ② 变体(variant)为 RFC 4122:第 17 个十六进制字符属于 8 / 9 / a / b 之一。
    This tool enforces: (1) version = 4 (13th hex is 4), (2) variant = RFC 4122 (17th hex in 8/9/a/b).
  • 适用场景 · Common use cases
    ✅ 数据库主键(尤其是多机/多区域写入) · DB primary keys (multi-writer / multi-region)
    ✅ 幂等请求 ID(防重复提交) · Idempotency keys (deduplicate requests)
    ✅ 事件/日志追踪(trace id / correlation id) · Event/log correlation IDs
    ✅ 测试数据批量造数 · Bulk test fixtures / mock data
    ⚠️ 不建议把 UUID 当作“密码/密钥”使用。UUID 不是为保密设计的;需要密钥请用随机令牌(token)或专用密钥管理。
    Not recommended as a “password/secret key”. UUID is not designed for secrecy; use secure random tokens or a proper key management approach instead.
  • 隐私与安全 · Privacy & Security
    本页面在浏览器本地生成 UUID,不会上传到服务器;刷新页面后历史结果不会被保存(除非你手动复制/导出)。
    Generated locally in your browser; no data is uploaded. Results aren’t stored after refresh unless you copy/export them.
  • 输出格式建议 · Output format tips
    – 需要导入 Excel/数据库:选“每行一个”。One-per-line is great for imports.
    – 需要粘贴到 SQL:选“逗号分隔”,再自行包一层引号或在脚本中处理。Comma-separated works for SQL IN lists (wrap quotes as needed).
    – 需要给脚本/接口:选“JSON 数组”,可直接使用。JSON array is ready for scripts/APIs.
  • 说明 · Disclaimer
    本工具仅用于开发与测试用途的快速生成,不对任何“绝对唯一性”做法律或业务担保;在极端情况下仍存在碰撞概率(虽然非常非常低)。
    This tool is for development/testing convenience. It does not provide legal/business guarantees of absolute uniqueness (collisions are theoretically possible, though extremely unlikely).

小提示 · Tip:如果你在做分布式系统/交易系统,UUID v4 常用于“请求追踪”,但对数据库索引不一定最友好(随机写入会带来碎片/页分裂)。这种场景可考虑“有序 ID”(例如 ULID/UUIDv7 等)作为替代。
Tip: For distributed systems, UUID v4 is great for tracing, but may be less index-friendly in some DBs due to random inserts. Consider ordered IDs (ULID/UUIDv7) when appropriate.