Free UUID Generator Online

This free UUID generator creates cryptographically random UUID v4 identifiers instantly in your browser. Generate a single UUID or bulk generate up to 20 at once. Each UUID is produced using crypto.getRandomValues() for a secure random UUID every time. Copy any result with one click. No signup, no server, no rate limit.

Options
Quantity
No UUIDs generated yet
Set a quantity above and click Generate
UUID v4 format
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
xRandom hex digit (0-9, a-f)
4Version indicator (always 4)
yVariant bits (8, 9, a, or b)
128 bits122 random + 6 fixed

How to generate UUID v4 online

  1. Click Generate to create one UUID v4 immediately.
  2. To bulk generate UUIDs, set the quantity field (up to 20) before clicking Generate.
  3. Each UUID appears in the standard 8-4-4-4-12 lowercase hyphenated format.
  4. Click the copy icon next to any UUID to copy it to your clipboard.
  5. Click Generate again for a completely new set of random UUIDs.

UUID v4 format, length, and structure

A UUID v4 always follows the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is a random hex digit (0-9, a-f) and y is one of 8, 9, a, or b. The digit at position 13 (first character of the third group) is always 4, indicating version 4. The digit at position 17 (first character of the fourth group) is always 8, 9, a, or b, indicating the RFC 4122 variant. A full UUID v4 example: f47ac10b-58cc-4372-a567-0e02b2c3d479.

UUID v4 length is always 36 characters as a formatted string: 32 hexadecimal characters plus 4 hyphens. As binary it is exactly 16 bytes (128 bits). Of those 128 bits, 122 are random data and 6 are reserved for the version (4) and variant (RFC 4122) indicators. The regex for UUID v4 validation is /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i. This pattern validates the version digit and variant range exactly.

UUID vs GUID: same thing, different name

GUID (Globally Unique Identifier) is Microsoft's name for the exact same 128-bit identifier defined by RFC 4122. A GUID generator and a UUID generator produce identically structured values. The term UUID is used in Unix, Linux, Java, web APIs, and most open-source ecosystems. The term GUID is used in Windows, .NET, SQL Server, and COM/ActiveX contexts. Both follow the same 8-4-4-4-12 hexadecimal format.

In SQL Server, NEWID() generates a GUID equivalent to UUID v4. In .NET, Guid.NewGuid() produces the same. The values from this online UUID generator are interchangeable with GUIDs in any system that accepts the standard hyphenated format. If a system requires the GUID without hyphens (32 hex characters only), remove the hyphens from the copied value before use.

JavaScript and Node.js UUID v4 generation

Modern JavaScript environments have a built-in UUID generator. In browsers and Node.js 19+, crypto.randomUUID() returns a UUID v4 string directly with no dependencies. This is the same API this tool uses internally. For older Node.js versions or environments without crypto.randomUUID(), the uuid npm package is the standard solution:

import { v4 as uuidv4 } from 'uuid'; const id = uuidv4(); — works in Node.js, TypeScript, React, and any bundled frontend. In React, generate UUIDs outside the render function or inside a useRef or useState initializer to avoid generating a new ID on every render. Never use Math.random()-based UUID functions in production — they are not cryptographically secure and can produce predictable sequences. For other cryptographically secure tokens, the password generator also uses crypto.getRandomValues() as its random source.

Python UUID generator

Python includes UUID generation in the standard library with no installation needed. import uuid; str(uuid.uuid4()) returns a UUID v4 string. uuid.uuid4().hex returns the same value without hyphens (32 hex characters). Python's uuid4() uses os.urandom() internally, which draws from the OS cryptographic random source — equivalent in security to crypto.getRandomValues() in the browser.

In Django, adding a UUID primary key to a model uses models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False). In FastAPI and SQLAlchemy, UUID columns map to the UUID type. For Flask APIs returning UUID values in JSON responses, serialize with str(uuid.uuid4()) since the UUID object itself is not JSON serializable by default. Use the JSON formatter to inspect API responses containing UUID fields.

PostgreSQL uuid_generate_v4 and native UUID support

PostgreSQL has native UUID support. The uuid_generate_v4() function from the uuid-ossp extension generates a random UUID v4: CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; SELECT uuid_generate_v4();. In PostgreSQL 13+, the built-in gen_random_uuid() function requires no extension and uses the pgcrypto module's random source. Both produce valid UUID v4 values.

To set a UUID column as a default primary key in PostgreSQL: id UUID PRIMARY KEY DEFAULT gen_random_uuid(). This eliminates the need to generate UUIDs in application code before insertion. MySQL 8+ provides UUID() (version 1, time-based) and UUID_TO_BIN(UUID(), 1) to store it as binary(16). When pre-generating UUIDs to insert into database seed scripts or test fixtures, use this bulk UUID generator to produce the exact number of identifiers needed and copy them directly into your SQL or JSON.

UUID use cases for developers

UUID v4 is the default choice for database primary keys in distributed systems because it requires no coordination. Unlike auto-incrementing integers, UUID keys can be generated by any application server, any client, or the database itself with zero risk of collision and no single point of coordination. This makes UUID primary keys ideal for multi-region databases, event sourcing, CQRS architectures, and any system where rows may be created offline and synced later.

Other common uses: file upload naming (UUID as filename prevents path traversal and collisions), API request tracing (UUID as correlation ID passed in the X-Request-ID header across microservices), idempotency keys in payment APIs to safely retry requests, session identifiers in web applications, and test data generation where each entity needs a unique stable identifier. For content-addressed identifiers where the same input must always produce the same ID, use UUID v5 with SHA-1 hashing. For hash-based verification of content, the SHA hash generator produces SHA-256 and SHA-512 digests from any input.

Frequently asked questions

UUID stands for Universally Unique Identifier. It is a 128-bit identifier standardized by RFC 4122 and formatted as a 36-character string of hexadecimal digits separated by hyphens in the pattern 8-4-4-4-12. UUIDs are designed to be unique across space and time without requiring a central authority to coordinate assignment. They are used as database primary keys, API resource identifiers, session tokens, file upload names, and correlation IDs in distributed systems.

A UUID v4 follows the format xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx where x is any random hexadecimal digit (0-9, a-f) and y is one of 8, 9, a, or b. The character at position 13 (the first digit of the third group) is always 4, indicating version 4. The character at position 17 (the first digit of the fourth group) is always 8, 9, a, or b, indicating the RFC 4122 variant. Example: 550e8400-e29b-41d4-a716-446655440000. The total string length including hyphens is always 36 characters.

A UUID v4 is always exactly 36 characters long as a formatted string: 32 hexadecimal characters plus 4 hyphens. As raw binary it is 16 bytes (128 bits). In a database, storing a UUID as a CHAR(36) string uses 36 bytes. Storing it as a native UUID type (available in PostgreSQL, MySQL 8+, and others) uses 16 bytes. Storing it as a binary(16) column also uses 16 bytes. The 128-bit representation contains 122 bits of actual random data, with 6 bits reserved for the version and variant indicators.

UUID v1 is generated from the host MAC address and current timestamp. It is sortable by creation time but exposes hardware and timing information, which is a privacy concern. UUID v4 is generated entirely from cryptographically random bits with no connection to any device, location, or timestamp. It is appropriate for most applications. UUID v5 is generated deterministically from a namespace UUID and a name string using SHA-1 hashing. The same namespace and name always produce the same UUID v5, making it useful for content-addressed identifiers. UUID v7 (a newer standard) is time-ordered random, combining the sortability of v1 with the privacy of v4.

GUID stands for Globally Unique Identifier and is Microsoft's term for the same 128-bit identifier standard defined by RFC 4122. A GUID and a UUID are the same thing. The term GUID is used in Windows, .NET, SQL Server, and COM programming contexts. The term UUID is used in Unix, Linux, Java, and web API contexts. Both follow the same 8-4-4-4-12 hexadecimal format. A GUID generator and a UUID generator produce identically structured values. SQL Server uses NEWID() to generate a GUID, which is equivalent to a UUID v4.

In modern browsers and Node.js 19+, use the built-in crypto.randomUUID() method: const id = crypto.randomUUID(). This returns a v4 UUID string directly. In older Node.js versions, use the uuid package: import { v4 as uuidv4 } from "uuid"; const id = uuidv4(). In React and TypeScript, both approaches work — crypto.randomUUID() for client-side generation in modern browsers, or the uuid package for broader compatibility. Avoid Math.random()-based UUID implementations as they are not cryptographically secure.

Python's standard library includes the uuid module. To generate a UUID v4: import uuid; str(uuid.uuid4()). This returns a string like "550e8400-e29b-41d4-a716-446655440000". To get the UUID without hyphens: uuid.uuid4().hex. To use a UUID as a primary key in Django models, use models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True). Python's uuid4() uses os.urandom() as its random source, which draws from the operating system's cryptographically secure random number generator.

In theory a collision is possible since UUID v4 is based on random bits. In practice the probability is so small it is treated as zero for all engineering purposes. A UUID v4 has 122 bits of randomness, giving a keyspace of approximately 5.3 × 10^36 possible values. If you generated one billion UUIDs per second, it would take approximately 85 billion years to reach a 50 percent probability of a single collision. All major database and distributed systems engineering guides treat UUID v4 as collision-free without any deduplication layer.

Related articles

Related tools