Skip to content
DocsAll
教程

UUID Generator: Principles and Use Cases of Unique Identifiers

Timi Tian · Published on May 12, 2026 · Updated on July 12, 2026
uuidguidUnique IdentifierUUID Generation

What Is a UUID

A UUID (Universally Unique Identifier) is a 128-bit identifier, with the standard format being an 8-4-4-4-12 hexadecimal string:

550e8400-e29b-41d4-a716-446655440000

The core value of UUID is "generating globally unique IDs without central coordination." guid and UUID are different names for the same concept.

Main UUID Versions

UUID v1 (Time-based + MAC Address)

Generated from the current timestamp and the machine's MAC address. Advantage: sortable. Disadvantage: exposes hardware address.

UUID v4 (Random)

Generated entirely from random numbers, the most widely used version. Advantage: simple to implement, no machine info leakage, extremely low collision probability. Disadvantage: not sortable.

UUID v5 (Namespace-based + SHA-1)

Generated from a namespace UUID and a name via SHA-1 hashing. Advantage: same input produces same result, reproducible.

Typical Use Cases

  • Database primary keys: Distributed databases use UUID v4 as primary key to avoid auto-increment ID conflicts
  • File naming: User-uploaded files named with unique identifiers to prevent overwriting by name collision
  • Session ID / Token: Login sessions, API tokens generated with UUID v4
  • Distributed task tracking: Microservice tracing uses UUID for identification
  • Anonymous user identification: Statistics and tracking scenarios assign UUIDs to anonymous users

DocsAll UUID Generator Usage

DocsAll provides an online UUID generator that supports batch generation:

1. Select Version

Choose v1, v4, or v5 from the dropdown.

2. Set Quantity

Enter the number of UUIDs to generate, supporting 1-1000 at once.

3. Select Format Options

Uppercase/lowercase, with or without hyphens, with or without braces (GUID style).

4. Generate and Copy

Click the "Generate" button, results are displayed in a list, and can be copied with one click.

Usage Tips

  • Use v4 for most scenarios — simple and reliable
  • Choose v5 with a fixed namespace when reproducible IDs are needed
  • For database primary keys, use v4 and index the field
  • Removing hyphens for file naming is cleaner

Combined with Timestamp Conversion, Base64 Encode/Decode, and other tools, daily development identifier processing can be done efficiently.

T
Timi Tian 创始人 / 全栈工程师

DocsAll 创始人,10 年全栈开发经验,专注浏览器端文档处理技术与隐私保护架构。前新加坡科技公司技术负责人。