Unix timestamp converter
About Timestamp Converter
This Unix timestamp converter turns epoch time into readable dates and back. Paste Unix seconds, milliseconds, a 16-digit microsecond value, an ISO 8601 string or the word "now". You get the instant in UTC, in your local time zone, and as relative time like "in 3 days".
Put one timestamp per line to convert many at once. The output is JSON with unixSeconds, unixMillis, ISO, UTC, local and relative values for each line. It is a quick way to check whether a JSON timestamp is in seconds or milliseconds.
Runs in your browser. Nothing is uploaded, and it works offline.
How it works
Automatic unit detection
The digit count picks the unit. 16 or more digits means microseconds. 13 or more digits, or a value of at least 1e12, means milliseconds. Anything shorter is Unix seconds. So 1751961600 is seconds and 1751961600000 is milliseconds, with no dropdown needed.
Seconds vs milliseconds: count the digits
For dates between September 2001 and November 2286, epoch seconds have 10 digits and milliseconds have 13. Microseconds have 16 and nanoseconds 19. A date in January 1970 usually means milliseconds were read as seconds. A date thousands of years ahead means the opposite. Divide nanosecond values (Go's UnixNano, Python's time.time_ns) by 1,000,000 before pasting.
unixSeconds and unixMillis in every result
Each result has unixSeconds and unixMillis for the same instant, so you can copy whichever unit your system expects. unixSeconds is floored, not rounded. That matches how most languages truncate to whole seconds and never gives a time in the future.
ISO strings and "now"
Any string the browser's Date can parse works, including ISO 8601 with or without an offset (2026-08-01T00:00:00Z). Type "now" on a line to convert the current moment and get the current epoch in seconds and milliseconds.
JavaScript: Date.now() and Math.floor(Date.now() / 1000)
JavaScript counts time in milliseconds. Date.now() and new Date().getTime() return epoch milliseconds (13 digits today). Math.floor(Date.now() / 1000) gives Unix seconds for APIs, JWT exp and iat claims, and databases that expect seconds. To go back, use new Date(seconds * 1000). Forgetting the * 1000 is the classic bug that puts every date in 1970.
Relative time with Intl.RelativeTimeFormat
The relative value uses the standard Intl.RelativeTimeFormat API with numeric: "auto", which is why you see "yesterday" instead of "1 day ago". The API only formats a value and unit you pass in, so rtf.format(-3, "hour") returns "3 hours ago". The converter picks the largest unit that fits (year, month, week, day, hour, minute or second) and rounds to it. Months and years use 30- and 365-day approximations, so treat long spans as rough.
Timestamps inside JSON: ISO 8601 vs epoch
JSON has no date type, so a timestamp travels as a string or a number. JSON.stringify(new Date()) writes a UTC ISO 8601 string such as "2026-09-24T12:00:00.000Z". JSON.parse does not turn it back into a Date, so you get a plain string. ISO 8601 (or its RFC 3339 profile) is readable and self-describing. Epoch numbers are compact but do not say whether they are seconds or milliseconds, so put the unit in the field name (createdAtMs, expiresAtSeconds). Nanosecond epochs exceed Number.MAX_SAFE_INTEGER and lose precision as JSON numbers, so send them as strings.
One line or many
A single timestamp returns one JSON object. Several lines return a JSON array with one entry per line. If a line is not a valid timestamp, the tool stops and names that line number instead of skipping it.
Frequently asked questions
How do I convert a Unix timestamp to a date?
Paste the epoch value on its own line. The converter returns the ISO 8601 date, a UTC string and your local time. It detects seconds or milliseconds from the size of the number.
What is the difference between Unix seconds and milliseconds?
Unix seconds count whole seconds since 1970-01-01T00:00:00Z (10 digits for current dates). Milliseconds count thousandths of a second (13 digits). JavaScript's Date, Java's System.currentTimeMillis() and many event pipelines use milliseconds. Unix tools, JWT claims, MySQL's UNIX_TIMESTAMP() and Python's time.time() use seconds. The converter shows both.
How can I tell if a timestamp is in seconds or milliseconds?
Count the digits. For a present-day value, 10 digits is seconds, 13 is milliseconds, 16 is microseconds and 19 is nanoseconds. If you paste one here and get a date far in the future or in January 1970, the unit was misread.
What is unixMillis?
unixMillis is the number of milliseconds since the Unix epoch, the same value Date.now() returns in JavaScript. Each result also includes unixSeconds, the same instant floored to whole seconds.
How do I get the current Unix timestamp in JavaScript?
Date.now() returns the current epoch time in milliseconds. For seconds, use Math.floor(Date.now() / 1000). Floor instead of rounding so the value never points into the future. Type now into this converter to see both values.
How do I show relative times like '3 hours ago' in JavaScript?
Use Intl.RelativeTimeFormat. Create a formatter with new Intl.RelativeTimeFormat("en", { numeric: "auto" }), compute the difference yourself, choose a unit, and call format(value, unit). Negative values are in the past. format(-1, "day") returns "yesterday" with numeric: "auto" and "1 day ago" with the default numeric: "always".
Should I store timestamps in JSON as ISO 8601 strings or epoch numbers?
Use ISO 8601 or RFC 3339 strings in UTC ("2026-09-24T12:00:00Z") for public APIs and anything people read. They are unambiguous and self-describing. Epoch numbers are fine for internal, high-volume data if the field name states the unit. Either way, JSON.parse gives you a string or a number, never a Date, so convert after parsing.
Does it handle ISO 8601 and time zones?
Yes. Any ISO 8601 string the browser can parse works, including a trailing Z or an offset like +02:00. The output always has a UTC string and your local time, so timestamps from different zones are easy to compare.
What happens to Unix timestamps in 2038?
Systems that store Unix seconds in a signed 32-bit integer overflow after 2038-01-19T03:14:07Z. Modern languages and databases use 64-bit values, and JavaScript's Date reaches far past that, so this converter handles dates after 2038.
Can I convert many timestamps at once?
Put one timestamp per line. Each line becomes an object in a JSON array. You can mix seconds, milliseconds, ISO strings and "now" in the same input.
Is my data uploaded when I convert timestamps?
No. Parsing and formatting use the browser's built-in Date and Intl APIs. Nothing is sent to a server.
Sources & last verified
We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.
Found a wrong result or an outdated claim? Report an error and we will check it again.