Hex Timestamp Converter
Convert Unix timestamps to hexadecimal and binary representations.
Timestamps in Hex — Why It Matters
Many real-world identifiers embed Unix timestamps as hexadecimal bytes. Knowing how to decode these lets you extract the creation time of a record without a separate timestamp column.
MongoDB ObjectID — the first 4 bytes (8 hex chars) are the creation timestamp in seconds, big-endian. The remaining 5 bytes are a random value and 3-byte incrementing counter.
UUID v1 — encodes a 60-bit timestamp in 100-nanosecond intervals since October 15, 1582 (the Gregorian reform date). The timestamp bytes are split across the first three fields of the UUID in a shuffled order.
Git objects — Git stores commit author and committer timestamps as Unix timestamps in the raw object data, rendered as hex in the packed object format.
Hex Timestamp Quick Reference
| Decimal | Hex (BE) | Date (UTC) |
|---|---|---|
| 0 | 00000000 | Jan 1 1970 00:00:00 |
| 1000000000 | 3B9ACA00 | Sep 9 2001 01:46:40 |
| 1700000000 | 655E2300 | Nov 14 2023 22:13:20 |
| 2000000000 | 77359400 | May 18 2033 03:33:20 |
| 2147483647 | 7FFFFFFF | Jan 19 2038 03:14:07 (32-bit max) |
Frequently Asked Questions
How do I read the timestamp from a MongoDB ObjectID?▼
Take the first 8 characters of the ObjectID hex string. Convert from base-16 to decimal. That is the Unix timestamp (seconds) of when the document was created. Example: ObjectID starting with "655e2300..." → parseInt("655e2300", 16) = 1700000000 → Nov 14 2023.
Why does UUID v1 use a different epoch than Unix?▼
UUID v1 timestamps count 100-nanosecond intervals since October 15, 1582, the start of the Gregorian calendar. To convert to Unix time, subtract 122192928000000000 (the number of 100ns intervals between 1582 and 1970) and divide by 10,000,000.
How do I convert hex to a Unix timestamp in Python?▼
int("655e2300", 16) returns 1700000000. Then use datetime.fromtimestamp(1700000000) to get the human date.
What is the 2038 problem in hex?▼
The maximum 32-bit signed integer is 0x7FFFFFFF = 2,147,483,647. Adding 1 second wraps to 0x80000000 = -2,147,483,648, which represents December 13, 1901. Systems using 64-bit integers are safe for billions of years.