Unix Timestamp (Epoch) Converter
Convert Unix timestamps in seconds or milliseconds to readable dates in UTC and your time zone, and dates back to epoch time. Free, runs locally.
Runs in your browser. Nothing is uploaded.
Example
Input:
1767225600
Result:
2026-01-01T00:00:00.000Z (seconds), 1767225600000 ms
Seconds or milliseconds?
A Unix timestamp counts time since 1 January 1970 00:00:00 UTC. Unix tools, JWT claims (exp, iat), most databases and many APIs use seconds; JavaScript's Date.now(), Java and many logging systems use milliseconds. The converter detects which one you pasted from its size (a 13-digit number is milliseconds) and shows both, so you can copy the form your code expects.
Output is shown in UTC as ISO 8601, in your browser's local time zone, and as a relative time such as "3 days ago". Paste a date the other way round (ISO 8601 or a plain date) to get its timestamp in seconds and milliseconds.
Time zones and common bugs
A timestamp has no time zone: it is the same instant everywhere. Bugs appear when it is formatted: new Date("2026-01-01") is parsed as UTC midnight, but new Date("2026-01-01T00:00") is parsed as local midnight, which is a different instant outside UTC. Store and send instants as UTC timestamps or ISO strings with Z, and convert to local time only for display.
The classic off-by-1000 bug is mixing units: passing seconds to new Date() gives a date in January 1970, and passing milliseconds where seconds are expected gives a date tens of thousands of years in the future. If a JWT seems to never expire or a cache entry expires instantly, check the unit first.
The year 2038 problem
Systems that store seconds in a signed 32-bit integer overflow on 19 January 2038 at 03:14:07 UTC. JavaScript numbers and 64-bit integers are safe for millions of years, but older C code, some embedded devices and MySQL TIMESTAMP columns are not, so prefer 64-bit types or DATETIME when you design a schema today.
MongoDB stores dates as 64-bit milliseconds since the epoch, so a Date field in Mongoose is already a timestamp under the hood and is safe well beyond 2038. When you need the creation time of a document without a createdAt field, its ObjectId also carries a timestamp in seconds.
Frequently asked questions
How do I get the current Unix timestamp in JavaScript?
Math.floor(Date.now() / 1000) gives seconds; Date.now() gives milliseconds.
How does the tool know seconds from milliseconds?
Numbers with 13 or more digits are treated as milliseconds and shorter ones as seconds. Both forms are shown either way.
Does a timestamp include a time zone?
No. It is an absolute instant; time zones only matter when you format it for display.
