UUID Generator (v4 & v7) · UUID Forge

Generate UUID v4 or v7 in bulk, ready to copy or export.

Updated:

100% client-side

Options

Result

    —

    What is a UUID?

    A UUID (Universally Unique Identifier) is a long, random-looking ID — like 3fa85f64-5717-4562-b3fc-2c963f66afa6 — used to label things (database rows, files, sessions) so that two different systems can generate IDs independently without ever colliding. UUID Forge generates these in bulk, in either the fully-random v4 format or the newer, timestamp-sortable v7 format.

    How to use the UUID generator (v4 & v7)

    1. Choose a version: v4 (random) or v7 (time-based).
    2. Set how many to generate in the "Count" field, and adjust formatting (Uppercase, With hyphens, Wrap in braces) if needed.
    3. Click Generate.
    4. Use Copy all, or download the list as .txt or .csv.

    How UUID v4 and v7 work (RFC 9562)

    A UUID (Universally Unique Identifier) is a 128-bit number designed to be unique without central coordination, standardized in RFC 9562. UUID v4 fills nearly all of those bits with cryptographic randomness; UUID v7 reserves the first 48 bits for a Unix timestamp in milliseconds, so newer values always sort after older ones. This tool sets the 4-bit version field and 2-bit variant field exactly as RFC 9562 specifies for each version:

    For how v4 and v7 are built and why v7 keys are faster in database indexes, read the guide UUID v4 vs. UUID v7: Which Should You Use?

    // v4 — fully random
    3fa85f64-5717-4562-b3fc-2c963f66afa6
    
    // v7 — starts with a timestamp, sortable
    018f2c3a-7b40-7c21-9a4e-2f1e6b8d0a11

    This tool uses the browser's native crypto.getRandomValues (the same cryptographic randomness source used by encryption keys) — no external libraries, no server calls.

    Examples

    UUIDs are random, so you will get different values each time; the samples below were generated with this tool to show what each setting produces.

    1. Three v4 UUIDs. 122 random bits each. The 4 that starts the third group is the version, and the first character of the fourth group is always 8, 9, a or b (the variant):

    fbcf3154-c422-4667-8846-4f0853a3d991
    deb67cc2-2333-46d0-8ee0-f2addd0c83b4
    4da5fa3a-92a4-451f-8ef1-c7657bd1bd69

    2. Three v7 UUIDs generated in the same millisecond. The first 12 hex digits are the Unix time in milliseconds — 01a1e2b2e5d8 is 2026-11-16 04:52:17.496 UTC — so v7 values created later always sort after earlier ones. Values created within the same millisecond share that prefix, and their order inside it is random:

    01a1e2b2-e5d8-7bce-88a4-9efe4995524c
    01a1e2b2-e5d8-79a8-837f-4e5ba81d1942
    01a1e2b2-e5d8-7181-a23d-5514f91fb918

    3. Formats for other systems. Uppercase + Wrap in braces gives the registry/GUID style used by Windows and .NET; unchecking With hyphens gives the 32-character form some databases and file names prefer:

    {01A1E2B2-EB37-762F-A914-332B9E18D5AE}     uppercase + braces
    4cd95a0d56e140f4bf6486903145e88e           no hyphens

    Common UUID mistakes

    • Using v4 as a primary key in large tables. Random v4 keys land all over a B-tree index, so every insert touches a different page; on big tables in PostgreSQL or MySQL/InnoDB that means more page splits and a colder cache. v7 keys arrive in time order and append to the end of the index like an auto-increment. Use v7 for database keys and v4 when you don't want the value to reveal when it was created.
    • Worrying about collisions. With 122 random bits, you would need to generate around 2.7 quintillion v4 UUIDs before the chance of a single duplicate reaches 50%. The real risk is a weak random source: this tool uses the browser's cryptographic generator (crypto.randomUUID and crypto.getRandomValues), never Math.random.
    • Leaking timing with v7. Because v7 embeds a timestamp, anyone holding the ID can read when it was created (example 2). Don't use v7 for values that must not reveal that, such as public invite or reset tokens.
    • Mixing formats. 4cd95a0d… and 4CD95A0D-… are the same UUID, but a string comparison says they differ. Normalize case and hyphens before storing or comparing, or use a native uuid column type.
    • Sorting v4 values. Ordering by a v4 column gives a random order, not creation order. If you need "newest first", sort by a timestamp column or switch to v7.

    UUID generator vs. the command line

    uuidgen on macOS and Linux prints one v4 UUID (macOS prints it in uppercase); python -c "import uuid; print(uuid.uuid4())" works anywhere Python is installed, and uuid.uuid7() exists from Python 3.14. In PostgreSQL, gen_random_uuid() returns a v4 and uuidv7() is built in from version 18. In the browser console, crypto.randomUUID() gives a v4. This page is handier when you need a batch of up to 1,000 values, v7, or a specific format to paste into a fixture, a CSV or a config file. Both versions are defined in RFC 9562. To decode the timestamp of a v7 by hand, convert the first 12 hex digits with the Number Base Converter and read the result in the Unix Timestamp Converter.

    Frequently asked questions

    What's the difference between UUID v4 and UUID v7?

    Both are defined in RFC 9562. UUID v4 is fully random. UUID v7 embeds a timestamp in the leading bits, so values generated in chronological order also sort alphabetically — ideal as a database primary key.

    How random are the UUIDs generated here?

    They're generated with crypto.getRandomValues, the browser's cryptographically secure API — the same randomness source used for encryption keys, not Math.random().

    How many UUIDs can I generate at once?

    Up to 1000 per batch, to keep generation instant without freezing the browser.

    Are any generated UUIDs saved on a server?

    No. All computation happens in your browser; nothing is sent to or logged by any server.