Unix timestamp converter
A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, the moment known as the Unix epoch. It is the most common way software stores an instant — in databases, log files, API responses, JWT tokens, and system calls — because it is a single number that is completely independent of time zones. This converter turns epoch values into readable dates and converts any date back into a timestamp, all in your browser.
Reading an epoch value
Enter an epoch value and choose seconds or milliseconds. The tool multiplies seconds by 1000 to build a JavaScript Date, then formats it four ways:
- UTC — the time at the zero-meridian, with no offset. This is the authoritative time the timestamp encodes.
- Local — shifted by your browser’s current time zone and daylight saving rule, so you can see what time it was in your clock timezone.
- ISO 8601 — the machine-readable standard form:
2021-01-01T00:00:00.000Z. The trailingZmeans UTC. - Relative — a human-readable label such as “3 hours ago” or “in 2 days”, computed from the current moment.
The reverse direction takes a date and time from the picker and reports the matching epoch seconds and milliseconds.
Seconds vs milliseconds — how to tell which you have
A 10-digit number is almost certainly in seconds. A 13-digit number is almost certainly in milliseconds. The two are related by a factor of exactly 1000.
| Value | Digit count | Unit | Resolves to (UTC) |
|---|---|---|---|
| 0 | 1 | seconds | 1970-01-01 00:00:00 |
| 1609459200 | 10 | seconds | 2021-01-01 00:00:00 |
| 1609459200000 | 13 | milliseconds | 2021-01-01 00:00:00 |
Reading a millisecond value as seconds points far into the future; reading a second value as milliseconds sends you to early 1970. The “1 January 1970” result almost always means you fed a seconds value into milliseconds mode (or passed zero or null somewhere upstream).
Common sources of epoch timestamps
- JWT tokens: the
exp,iat, andnbfclaims are Unix timestamps in seconds. Paste the number to see when a token expires. - HTTP headers:
Last-ModifiedandExpiresuse formatted dates, butX-RateLimit-Resetoften carries a Unix timestamp in seconds. - Log files: most logging frameworks emit milliseconds; older syslog-format timestamps are seconds.
- Databases: PostgreSQL stores
TIMESTAMPTZinternally as microseconds since the epoch; MySQL’sUNIX_TIMESTAMP()returns seconds. - JavaScript:
Date.now()returns milliseconds;Math.floor(Date.now() / 1000)gives seconds.
The Year 2038 problem
Systems that store Unix time in a signed 32-bit integer overflow on 19 January 2038 at 03:14:07 UTC, when the value exceeds 2,147,483,647 seconds. This was a real concern for embedded devices and 32-bit C code. Modern 64-bit systems store timestamps as int64 or equivalent, pushing the overflow hundreds of billions of years into the future — but old database columns typed as INT instead of BIGINT can still be affected.
Tips
- Negative timestamps represent dates before the epoch (before 1 January 1970). This is valid and well-supported in modern runtimes.
- When comparing timestamps across services, always canonicalise to the same unit — mixing seconds and milliseconds in a comparison is a silent, frequent bug.
- Everything runs in your browser using the built-in
Dateobject — nothing you type is ever uploaded.
The formal definition, and its one deliberate lie
POSIX defines “seconds since the Epoch” precisely — see the Open Group’s
definition —
as a count that excludes leap seconds, treating every day as exactly
86,400 seconds. That simplification is what makes epoch arithmetic safe
(day boundaries are always multiples of 86,400) at the cost of the count
drifting from the true number of elapsed SI seconds. For application work —
tokens, expiries, logs, scheduling — the simplification is exactly what you
want; specialised time scales exist for metrology. The value’s other great
property is universality: an epoch second is identical in every time zone
and locale, which is why it is the interchange format of choice between
systems that must never disagree about ordering. In JavaScript specifically,
Date
counts in milliseconds since the same epoch — the thousandfold difference
described above.