What is a hex timestamp?
A hex timestamp is a Unix timestamp written in hexadecimal (base 16) instead of decimal (base 10). Unix time counts the seconds since 1970-01-01 00:00:00 UTC (the Unix epoch). The same moment can be written as 1,600,000,000 in decimal or 5F5E1000 in hex.
Hex timestamps appear in log files, debug output, network packet captures, database records and embedded firmware. They take fewer characters than decimal (8 hex digits cover all dates from 1970 to 2106), and many systems display raw memory or register values in hex by default.
Pick a unit in the picture to see how the same digits change meaning.
How to convert hex to date
Convert the hex to a decimal integer, then read that integer as a Unix timestamp.
- Convert the hex string to a decimal number. 5F5E1000 in hex is 1,600,000,000 in decimal. Use the hex to decimal converter for this step.
- Treat the decimal number as the number of seconds since 1970-01-01 00:00:00 UTC.
- Add that many seconds to the epoch to get the date.
Worked example: 5F5E1000
5F5E1000 hex = 1,600,000,000 decimal
1,600,000,000 seconds after 1970-01-01 00:00:00 UTC
= 2020-09-13 12:26:40 UTCWorked example: 65A3D080
65A3D080 hex = 1,705,234,560 decimal
1,705,234,560 seconds after 1970-01-01 00:00:00 UTC
= 2024-01-14 12:16:00 UTCThe result is always in UTC. To get a local time, add or subtract the time zone offset. UTC+05:00 adds 5 hours; UTC−05:00 subtracts 5.
Millisecond and microsecond timestamps
Some systems store timestamps in milliseconds or microseconds instead of seconds. A 13-digit decimal (or 11-hex-digit) timestamp is milliseconds. A 16-digit decimal timestamp is microseconds, and it takes 13 hex digits for dates around today.
| Hex length | Unit | Divide by | Example |
|---|---|---|---|
| 8 digits | Seconds | 1 | 5F5E1000 → 2020-09-13 |
| 11 digits | Milliseconds | 1,000 | 174876E8000 → 2020-09-13 |
| 13 digits | Microseconds | 1,000,000 | 5AF3107A40000 → 2020-09-13 |
Divide the decimal value by the unit factor to get seconds, then convert to a date.
MongoDB ObjectId timestamps
The first 8 hex characters of a MongoDB ObjectId encode the creation time as a Unix timestamp in seconds. An ObjectId is 24 hex characters long, and the first 4 bytes (8 hex digits) are the timestamp.
ObjectId: 507f1f77bcf86cd799439011
Timestamp bytes: 507f1f77
507f1f77 hex = 1,350,508,407 decimal
= 2012-10-17 21:13:27 UTCThis built-in timestamp means every MongoDB document records when it was created, without a separate field.
Windows FILETIME
Windows FILETIME counts 100-nanosecond intervals since 1601-01-01 00:00:00 UTC, stored as a 64-bit (16-hex-digit) value. To convert a FILETIME to a Unix date:
- Read the 16 hex digits as a decimal number.
- Subtract 116,444,736,000,000,000 (the number of 100-ns intervals between the Windows epoch in 1601 and the Unix epoch in 1970).
- Divide by 10,000,000 to get seconds.
- Read the result as a Unix timestamp.
FILETIME: 01D84B10 2503DE00
01D84B102503DE00 hex = 132,938,721,720,000,000 decimal
Minus 116,444,736,000,000,000 = 16,493,985,720,000,000
Divided by 10,000,000 = 1,649,398,572 seconds
= 2022-04-08 06:16:12 UTCFILETIME values often appear in Windows event logs, NTFS file metadata and registry entries.
Common hex timestamps
| Hex | Decimal | Date (UTC) | Meaning |
|---|---|---|---|
| 00000000 | 0 | 1970-01-01 00:00:00 | Unix epoch |
| 3B9AC9FF | 999,999,999 | 2001-09-09 01:46:39 | Last 9-digit timestamp |
| 3B9ACA00 | 1,000,000,000 | 2001-09-09 01:46:40 | First 10-digit timestamp |
| 5F5E1000 | 1,600,000,000 | 2020-09-13 12:26:40 | 1.6 billion seconds |
| 65A3D080 | 1,705,234,560 | 2024-01-14 12:16:00 | Early 2024 |
| 7FFFFFFF | 2,147,483,647 | 2038-01-19 03:14:07 | Y2038 limit (signed 32-bit max) |
| FFFFFFFF | 4,294,967,295 | 2106-02-07 06:28:15 | Unsigned 32-bit max |
The Y2038 problem affects systems that store Unix time in a signed 32-bit integer. After 7FFFFFFF (2038-01-19 03:14:07 UTC), the next second overflows to 80000000, which reads as −2,147,483,648 (1901-12-13) in signed two's complement. Most modern systems use 64-bit timestamps, which overflow after about 292 billion years. The picture shows both readings of a 32-bit value.
Hex to date in JavaScript
const hex = "5F5E1000";
const seconds = parseInt(hex, 16);
const date = new Date(seconds * 1000);
console.log(date.toISOString());
// "2020-09-13T12:26:40.000Z"Date() takes milliseconds, so multiply the seconds by 1,000. For a hex millisecond timestamp, skip the multiplication.
Hex to date in Python
import datetime
hex_str = "5F5E1000"
seconds = int(hex_str, 16)
dt = datetime.datetime.fromtimestamp(seconds, tz=datetime.timezone.utc)
print(dt.isoformat())
# 2020-09-13T12:26:40+00:00Pass tz=datetime.timezone.utc to get a UTC-aware datetime. Without it, fromtimestamp returns local time, which depends on the server's time zone setting.
Date to hex (reverse conversion)
Convert the date to a Unix timestamp in seconds, then convert that integer to hex.
const date = new Date("2020-09-13T12:26:40Z");
const hex = Math.floor(date.getTime() / 1000).toString(16);
console.log(hex); // "5f5e1000"import datetime
dt = datetime.datetime(2020, 9, 13, 12, 26, 40, tzinfo=datetime.timezone.utc)
hex_str = hex(int(dt.timestamp()))
print(hex_str) # 0x5f5e1000For the full decimal-to-hex conversion method, see the decimal to hex converter.
Frequently asked questions
What is a hex timestamp?
How do you convert hex to a date?
parseInt(hex, 16) or int(hex, 16), then pass the result to a date function. In JavaScript, new Date(parseInt("5F5E1000", 16) * 1000) returns 2020-09-13. Multiply by 1,000 because JavaScript's Date takes milliseconds.What is the Y2038 problem?
How do you read the timestamp from a MongoDB ObjectId?
507f1f77bcf86cd799439011 starts with 507f1f77, which is 1,350,508,407 seconds, or 2012-10-17 21:13:27 UTC.What is the difference between hex seconds and hex milliseconds?
How does Windows FILETIME differ from Unix time?
Related tools
- Hex to decimal converter — convert hex integers to decimal with digit-by-digit steps
- Signed hex to decimal — interpret hex as a signed two's complement integer
- Hex to decimal in JavaScript — parseInt, Number and BigInt methods
- Hex to decimal in Python — int(), bytes and struct methods