fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/developer-tools/uuid-generator

Free UUID Generator Online

128 bits, and every one of them has a job.

Generate random v4 UUIDs or time-ordered v7 ones, one at a time or in bulk. IDs are created in your browser from its secure random generator. Hover the ID below to see what each part is for.

v4randomv7time-ordered
refreshNew IDcontent_copyCopy
5fc9060f-943b-4fbb-b4f0-21865d8a860f
random122 bitsEverything except the marker bits comes from the secure random generator.version4 bitsAlways 4 here, in the 13th hex digit.variant2 bitsTop bits of the 17th digit: 8, 9, a or b.no timestamp0 bitsv4 carries no time, so it reveals nothing about when it was made.
bulk
how many20
format
lowercaseUPPERCASEno dashesbase64url · 22
wrap as
one per lineJSON arraySQL VALUES
content_copyCopy alldownloadDownload .txt
output20 × v4 · 0.7 KB
85661817-6640-467d-8482-1506b47158b1e7da7280-07e2-4030-b0d4-a644c856f227fc2c0a69-6a20-4bc5-b86e-0210a3bf306d8ca3ed73-4f5d-4db7-8cae-6d5f050cac976ff9bc30-3e52-4880-848b-784f99001eca93a3a45b-7e2f-47c9-91fe-a5755cffe47f57de83db-e2ab-42c1-b9c6-8ac7ec7cb2c7635c48e2-1873-42d4-a453-200d296f79dec9b80ab0-fc96-4226-b239-b8f7775949c768a7d830-a24b-4664-9523-e86ae5b37d4057d409e1-3cef-45ff-a6e8-2769fcb6bc79edfd6c0d-c7aa-49ce-b3e7-e1df051701391b6e7d32-cf38-4a26-9576-084d5bae8be358ae6191-5ede-4a58-aca3-beab138d67c313c422e7-d84f-45e7-a9f1-376213426d6e7e548c13-de50-41b5-a481-726048401707684ae924-dfb8-4dc0-b379-53d233670694159d542b-9290-4a81-a868-52c446242a4457f84094-4149-47d3-9ed8-e37fbe674835a36dd241-ac93-4072-ba8e-9354a1c2a027
~/why-v7-exists

Random IDs scatter across a database index. Time-ordered ones line up.

A database keeps primary keys sorted. New v4 IDs land anywhere in that order, so the database keeps splitting pages to make room. v7 starts with a timestamp, so each new ID goes at the end, like an auto-increment number. Insert four rows and watch where they go.

v4 · randominserted mid-index
1223a26f3-86a0-4111-8422-9b358e0a7417222f5a9a8-e7e7-4b9a-82f1-672f423ae7e7+3349a083d3-3b02-48c7-bd2c-c681398c87a2+14566776e2-27e2-47ee-a6f6-a785cfacc500582c52490-04ed-428e-afc9-0b7f64befcf1+2682e54b7e-e126-497e-b392-c24504c3474e7a5af90ba-5aa7-48b2-83ec-543daa6ad0ae8d143c6b5-ff8d-4240-b94f-54fd262a10ce+49d538a62b-35e9-4b34-84e0-3b606e72573310dc31a16a-2f99-4cf8-afa7-83e4fcf82d7c
The four new rows land between existing ones. On a real table with millions of rows, each insert touches a different page, so writes are slower and the index bloats.
v7 · time-orderedappended at the end
101a0ec5e-f040-7ce5-96e8-a8a28bae11de201a0ec5f-daa0-745e-8090-c5a08e0bb6b7301a0ec60-c500-7d6f-ab9a-be09c6f4627d401a0ec61-af60-7b0f-8fc6-99fdcb0a1dda501a0ec62-99c0-74e4-9b91-d53ce2b1e7ba601a0ec63-8420-74a4-ae32-bb6cef37d293701a0ec64-6e80-7921-9d53-eb7dba8bf716+1801a0ec64-6e87-781b-95b6-1130f57d4502+2901a0ec64-6e8e-7f36-ad1c-527684129d4b+31001a0ec64-6e95-7da6-8189-e607d0ccd421+4
All four new rows sort after the existing ones, because their timestamps are later. The index only grows at the end, which keeps it compact and fast.
replayInsert four new rows
~/will-two-ever-match

Could two random UUIDs ever be the same?

In principle yes; in practice no. A v4 UUID has 122 random bits. Using the birthday-problem estimate, pick how fast you create IDs and for how long, and see the odds of even one duplicate.

ids per second
10a small app1,000busy API1 millionhuge system1 billionevery phone on Earth
for how long
1 day1 year100 years1 billion years
ids created3.2 trillionchance of any duplicate9.4 × 10⁻¹³
Far less likely than your hardware silently corrupting the ID. You can treat v4 UUIDs as unique without checking.
~/pick-the-right-one

Which version for which job.

The short answer is v7 for database keys and v4 for everything else. The details matter for a few cases.

databaseDatabase primary keyv7Sorts by creation time, so inserts stay fast and you can page through rows by ID.
publicPublic URLs and linksv4Reveals nothing. A v7 in a URL leaks the exact millisecond the record was made.
syncOffline-first appsv7Devices create IDs without talking to a server, and they still merge in time order.
keySession and reset tokensneitherUse a dedicated secret with more randomness. A UUID is an identifier, not a password.
receipt_longEvent and log IDsv7Lets you sort and roughly timestamp events from the ID alone.
upload_fileFile and upload namesv4Avoids name clashes and doesn’t hint at upload order to anyone guessing names.
~/decode-any-uuid

Paste a UUID and read what’s inside it.

The 13th hex digit gives the version and the top bits of the 17th give the variant. From there each version has its own layout. v1 and v6 hide a 60-bit count of 100-nanosecond ticks since the Gregorian calendar reform of 15 October 1582, plus a clock sequence and node ID that can be a real MAC address. v7 holds Unix milliseconds. Paste any ID, or try the examples.

v1v4v5v6v7nilmaxthis page’s ID
verifiedVersion 1 · Gregorian time60-bit 100 ns timestamp, clock sequence, 48-bit node (often the MAC).
version1variantRFC 9562 (10xx)timestamp2022-02-22 19:22:22.000 UTCcanonical formyes, lowercase
fieldhexbitsvalue
time_lowc232ab0032least significant 32 bits of the timestamp
time_mid941416next 16 bits
version141 · Gregorian time + node
time_high1ec12top 12 bits → 60-bit tick count 138648505420000000
variantb2top bits 10 → RFC 9562 (10xx)
clock_seqb3c81413256 (variant bits removed)
node9f6bdeced846489f:6b:de:ce:d8:46 · multicast bit set: random, not a MAC
~/v5-deterministic

Same name in, same UUID out, on every machine.

Version 5 doesn’t use randomness at all. It hashes a namespace UUID followed by a name with SHA-1, keeps the first 16 bytes and overwrites six bits with the version and variant. Two systems that never talk can derive the same ID for “example.com”. Computed below with this browser’s Web Crypto. Version 3 is identical but uses MD5.

namespace
DNSURLOIDX.500
6ba7b810-9dad-11d1-80b4-00c04fd430c8
SHA-1(namespace bytes ‖ UTF-8 name), first 16 of 20 bytes886313e13b8a53725b900c9aee199e5d 94d841da
uuid5(namespace, name)
886313e1-3b8a-5372-9b90-0c9aee199e5d
Highlighted digits were changed from the hash: the 13th to 5 for the version, and the 17th so its top two bits read 10 for the variant.
verifiedMatches the documented result of Python’s uuid.uuid5(uuid.NAMESPACE_DNS, "python.org").
~/spec-sheet

UUIDs, for reference.

All eight versions in RFC 9562, which replaced RFC 4122 in May 2024, with the two special values and the identifiers that compete with UUIDs.

vernamebuilt fromsortablestatus
1Gregorian time60-bit 100 ns timestamp, clock sequence, 48-bit node (often the MAC)noLegacy; leaks host and time. Use 6 or 7
2DCE Securityv1 with a POSIX UID or GID in place of part of the timenoReserved; RFC 9562 leaves it undefined
3Name-based, MD5MD5 of namespace + namenoAllowed; prefer 5 for new work
4Random122 random bitsnoThe everyday default
5Name-based, SHA-1SHA-1 of namespace + name, truncatednoDeterministic IDs; not for security
6Reordered timev1 fields reordered high to low so they sortyesFor systems already using v1
7Unix time48-bit Unix ms, then 74 random bitsyesRecommended for new database keys
8Custom122 bits laid out by the implementationdependsExperimental and vendor-specific formats
StandardRFC 9562May 2024; obsoletes RFC 4122 (2005). Also ITU-T X.667 and ISO/IEC 9834-8
Size128 bits · 16 bytes36 characters in the 8-4-4-4-12 text form
Text formlowercase hexReaders must accept uppercase; output should be lowercase
URNurn:uuid:…RFC 9562 registers the uuid URN namespace
Byte orderbig-endianMicrosoft GUIDs store the first three fields little-endian in binary
Special valuesNil · Max00000000-… and ffffffff-…
Random bits122 in v4 · 74 in v7Six bits always go to version and variant
Browser APIcrypto.randomUUID()Returns a v4 string; secure contexts only
Databasesuuid typePostgreSQL 18 adds uuidv7(); MySQL stores BINARY(16)
alternativelengthtrade-off
ULID26 charsSame idea as v7 in Crockford Base32; not an RFC
Snowflake64 bitsTwitter’s time + machine + sequence; needs coordination
KSUID27 chars32-bit seconds + 128 random bits, by Segment
NanoID21 charsRandom, URL-safe alphabet; no time order
CUID224 charsHashed, collision-resistant, hides time
1980sApollo NCSApollo Computer’s Network Computing System introduces 64-bit then 128-bit unique IDs.
1990sOSF DCEThe Distributed Computing Environment defines UUID versions 1 and 2.
1996COM GUIDsMicrosoft adopts UUIDs as GUIDs for COM and Windows.
2005RFC 4122Versions 1 to 5 standardised by the IETF.
2016ULIDA sortable alternative spreads, prompting the time-ordered versions.
2021crypto.randomUUIDBrowsers ship a built-in v4 generator.
2024RFC 9562Adds versions 6, 7 and 8 plus the Max UUID.
2025uuidv7() in PostgresPostgreSQL 18 generates v7 natively.