Hex to Decimal

Hex to Date Converter

Type a hex timestamp to see the date it stands for, in UTC and in your own time zone.

From hex to calendar

UTC
Your time zone
Unix seconds
Weekday

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.

  1. 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.
  2. Treat the decimal number as the number of seconds since 1970-01-01 00:00:00 UTC.
  3. 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 UTC

Worked 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 UTC

The 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 lengthUnitDivide byExample
8 digitsSeconds15F5E1000 → 2020-09-13
11 digitsMilliseconds1,000174876E8000 → 2020-09-13
13 digitsMicroseconds1,000,0005AF3107A40000 → 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 UTC

This 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:

  1. Read the 16 hex digits as a decimal number.
  2. 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).
  3. Divide by 10,000,000 to get seconds.
  4. 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 UTC

FILETIME values often appear in Windows event logs, NTFS file metadata and registry entries.

Common hex timestamps

HexDecimalDate (UTC)Meaning
0000000001970-01-01 00:00:00Unix epoch
3B9AC9FF999,999,9992001-09-09 01:46:39Last 9-digit timestamp
3B9ACA001,000,000,0002001-09-09 01:46:40First 10-digit timestamp
5F5E10001,600,000,0002020-09-13 12:26:401.6 billion seconds
65A3D0801,705,234,5602024-01-14 12:16:00Early 2024
7FFFFFFF2,147,483,6472038-01-19 03:14:07Y2038 limit (signed 32-bit max)
FFFFFFFF4,294,967,2952106-02-07 06:28:15Unsigned 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:00

Pass 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)   # 0x5f5e1000

For the full decimal-to-hex conversion method, see the decimal to hex converter.

Frequently asked questions

What is a hex timestamp?
A hex timestamp is a Unix timestamp written in hexadecimal. Unix time counts seconds since 1970-01-01 00:00:00 UTC. The hex form takes fewer characters: 8 hex digits cover all 32-bit timestamps from 1970 to 2106.
How do you convert hex to a date?
Convert the hex to decimal with 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?
Systems that store Unix time in a signed 32-bit integer overflow on 2038-01-19 at 03:14:07 UTC. The hex value 7FFFFFFF is the largest positive signed 32-bit integer. The next second wraps to 80000000, which reads as a negative number (a date in 1901). Most modern systems use 64-bit timestamps to avoid this.
How do you read the timestamp from a MongoDB ObjectId?
Take the first 8 hex characters and convert them to a Unix timestamp. 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?
A hex second timestamp has 8 digits for dates between 1970 and 2106. A hex millisecond timestamp has 11 digits for current dates. Divide a millisecond timestamp by 1,000 to get seconds before converting to a date.
How does Windows FILETIME differ from Unix time?
Windows FILETIME counts 100-nanosecond intervals since 1601-01-01, while Unix time counts whole seconds since 1970-01-01. To convert, subtract 116,444,736,000,000,000 from the FILETIME value and divide by 10,000,000.