How a UUID is laid out
A UUID is 128 bits written as 32 hex digits in groups of 8-4-4-4-12. The first digit of the third group is the version (4 or 7 here) and the first digit of the fourth group is the variant (8, 9, a or b for standard UUIDs). In v7 the first 48 bits are the Unix time in milliseconds, which is why v7 IDs made a second apart share their first few characters. To match UUIDs in text, see the UUID regex.
In code
crypto.randomUUID() // browsers & Node 19+: v4 import uuid; uuid.uuid4() # Python uuid.uuid7() # Python 3.14+ SELECT gen_random_uuid(); -- PostgreSQL 13+ (v4); uuidv7() in PostgreSQL 18