s / ms / μs / ns
Unix ns / μs
Decode or build Unix time at second through nanosecond resolution.
Unix precision
Paste an integer (auto-detects unit by length), or pick a date.
This page converts POSIX time at four resolutions: seconds, milliseconds, microseconds, and nanoseconds. Paste an integer and leave Unit on Auto, or force a unit when the digit length is misleading. Pick a UTC calendar date to emit all four integers at midnight. The everyday Unix timestamp converter still owns live “now” and common second-or-millisecond debugging. This spoke is the BigInt round-trip for μs and ns, so low digits are not rounded away before the civil ISO line is shown.
How to convert without a hardcoded civil example
Paste the integer from the log. Leave Unit on Auto unless you already know the column’s unit. Read the ISO-8601 UTC line, then read the four listed integers. To go the other way, pick a calendar date; the page emits seconds, milliseconds, microseconds, and nanoseconds for that UTC midnight. Recalculate a sample for 2026 when writing docs so screenshots match current digit lengths.
A Python service that stores time.time_ns() and a browser chart that uses Date.now() must meet on the same instant. Convert one sample both ways so the chart’s millisecond axis matches the nanosecond column after dividing by one million. Database migrations from DATETIME to BIGINT should name the unit in the column (ts_ms versus ts_ns). Convert a known civil date here and paste the integer into a unit test.
Why BigInt instead of JavaScript Number
JavaScript’s Number cannot hold every nanosecond since 1970 as an integer. MAX_SAFE_INTEGER is 2^53−1. A nineteen-digit nanosecond already exceeds that safe integer range, so ordinary division rounds the low digits before you ever format a date. This page uses BigInt for microsecond and nanosecond input so the integer is divided with exact integer arithmetic, then converted to milliseconds only for the Date display step.
That display step still snaps to JavaScript Date millisecond resolution. Listed microseconds and nanoseconds in the result are reconstructed from the millisecond instant (ms×1,000 and ms×1,000,000). Sub-millisecond remainder from the original integer is not preserved after that reconstruction. Keep the original BigInt in the log if a forensic remainder below one millisecond matters.
Frequently asked questions
What unit does a nineteen-digit Unix integer usually represent?
Auto-detect treats seventeen or more digits as nanoseconds since 1970. A matching microsecond value is about sixteen digits, milliseconds about thirteen, and whole seconds about ten. Override the Unit menu when a clock stores leftover zeros. Confirm the civil ISO line against a known midnight in 2026 before trusting a log parser.
How does this page keep nanosecond integers from rounding?
Microsecond and nanosecond input is divided with BigInt integer arithmetic, then converted to milliseconds only for the Date display. JavaScript Number cannot hold every nanosecond since 1970 as a safe integer. Listed nanoseconds in the result are reconstructed from milliseconds, so keep the original integer if a remainder below one millisecond still matters.
Why can JavaScript Number not store every nanosecond?
Number is an IEEE floating value with a safe integer limit of two to the fifty-third minus one. A nineteen-digit nanosecond already exceeds that limit, so ordinary division rounds low digits before a date is formatted. BigInt avoids that rounding on the way down to milliseconds. The ISO line still cannot show leftover nanoseconds below one millisecond.