Developer · Identifiers

UUID v7 & ObjectId timestamp decoder.

Paste a UUID v7 or a MongoDB ObjectId and read the date it was created. Everything runs in your browser.

Advertisement

Identifier

The type is detected from the length: 24 hex digits is an ObjectId, 32 is a UUID.

Decoded

Paste an identifier, then press Decode.

Where the timestamp lives

UUID v7 (RFC 9562 section 5.7) starts with unix_ts_ms, a 48-bit big-endian count of milliseconds since 1970-01-01 UTC in the first six bytes. The version nibble (the 13th hex digit) is 7 and the variant bits are 10. The RFC's example 017F22E2-79B0-7CC3-98C4-DC0C0C07398F holds 0x017F22E279B0 = 1645557742000 ms = 2022-02-22 19:22:22 UTC.

MongoDB ObjectId is 12 bytes: a 4-byte timestamp in seconds since the Unix epoch, a 5-byte random value and a 3-byte counter. The timestamp is big-endian. The MongoDB manual builds 6592008029c8c3e4dc76256c from 2024-01-01 UTC, whose seconds value is 0x65920080 = 1704067200.

Sources: RFC 9562, section 5.7 and Appendix A.6; MongoDB manual, ObjectId().

Frequently asked questions

Why does my UUID say it is not v7?

Only version 7 stores a timestamp at the front. The common random UUID v4 does not, so no date can be recovered from it.

How precise is an ObjectId date?

To the second. UUID v7 is to the millisecond.

Is the ID sent anywhere?

No. Decoding happens locally in your browser.

Creation time as claimed by the ID

The date is whatever the generating system's clock said or whatever a client supplied. It is not proof of when a record was created.

Advertisement
Advertisement
Listening…