CURRENT EPOCH · EPOCHTIME.TOOLS · A PRECISION INSTRUMENT FOR TIME
Converter Batch Difference Blog
Languages
JavaScript Python TypeScript Go Rust Java PHP SQL Bash
Specialty
LDAP Timestamp .NET Ticks Chrome/WebKit Cocoa / Core Data Discord Timestamp Excel OADate Unix Hex
Standards
ISO 8601 Guide Year 2038 NTP Timestamp GPS Time Julian Day
01 Input
Paste a hex value (e.g. 67742800 or 0x67742800) or a date string
Just Unix seconds expressed in base 16. 8 hex digits for current dates.
02 Output
Unix hex
Unix decimal
Unix milliseconds (hex)
Unix milliseconds (dec)
ISO 8601 (UTC)
Human-readable

What is a Unix hex timestamp?

A Unix hex timestamp is just a standard Unix timestamp (seconds since 1970-01-01 UTC) written in hexadecimal instead of decimal. There's no separate "hex format" — it's the same value, different base.

You'll encounter hex timestamps in:

Quick reference

DecimalHexDate
00x000000001970-01-01 00:00:00 UTC
9466848000x386D43802000-01-01 00:00:00 UTC
17356896000x677428002025-01-01 00:00:00 UTC
21474836470x7FFFFFFF2038-01-19 03:14:07 UTC (Y2038!)

Byte order matters

When extracting timestamps from binary files or network packets, you need to know the byte order (endianness):

Big-endian (network byte order, most file formats)

1735689600 (2025-01-01 UTC) → bytes: 67 74 28 00

Little-endian (x86 / x64 native)

1735689600 (2025-01-01 UTC) → bytes: 00 28 74 67

If you see what looks like a date but it's converting to an impossible value, try byte-swapping it.

Conversion

Hex string → Unix seconds

unix_seconds = parseInt(hex_string, 16)

Unix seconds → hex string

hex_string = unix_seconds.toString(16)

Code examples

JavaScript

// Hex to date (handles both "0x..." and bare hex)
function hexToDate(hex) {
  const clean = hex.toLowerCase().replace(/^0x/, '');
  const sec = parseInt(clean, 16);
  return new Date(sec * 1000);
}

// Date to hex (8-character zero-padded)
function dateToHex(date) {
  const sec = Math.floor(date.getTime() / 1000);
  return '0x' + sec.toString(16).padStart(8, '0');
}

// Swap byte order (big-endian ↔ little-endian)
function swapBytes(hex) {
  const clean = hex.replace(/^0x/, '').padStart(8, '0');
  return clean.match(/.{2}/g).reverse().join('');
}

Python

def hex_to_unix(hex_str: str) -> int:
    return int(hex_str.lstrip('0x'), 16)

def unix_to_hex(unix_sec: int) -> str:
    return format(unix_sec, '08x')

# Byte-swap (4-byte big-endian to little-endian and vice versa)
def swap_bytes(hex_str: str) -> str:
    h = hex_str.lstrip('0x').zfill(8)
    return ''.join(reversed([h[i:i+2] for i in range(0, len(h), 2)]))

Bash

# Hex to date
echo "67742800" | xargs -I {} printf "%d\n" 0x{} | xargs -I {} date -u -d @{}

# Date to hex
printf "%x\n" $(date +%s)

Tips for forensic work