Nanoseconds Converter

Exact conversions for durations of any size, from nanoseconds up to centuries.

Timestamp tool

A duration

Whole numbers of any size, or powers such as 2^63-1.

This converts a duration. To read a number as a point in time, use the Unix Timestamp Converter.

THE SAME DURATION
—
—

How to use this converter

  1. 1

    Enter the number. Any whole number, with or without spaces between digit groups, or a power such as 2^64 or 2^63-1.

  2. 2

    Choose its unit. Nanoseconds by default; microseconds, milliseconds, seconds, minutes, hours and days also work.

  3. 3

    Read every unit. All values are exact, with the days, hours, minutes and seconds spelled out, and years for scale.

Example

9,223,372,036,854,775,807 ns (2^63 − 1, the largest signed 64-bit integer) is 106,751 days, 23 h 47 min 16.854775807 s: about 292.28 years.

2^64 ns is 213,503 days, 23 h 34 min 33.709551616 s, about 584.55 years.

How it is calculated

Numbers this large lose precision in ordinary floating-point arithmetic, which keeps only about 16 significant digits. The converter uses exact integer arithmetic, so every digit of the result is correct; decimals are rounded only in the last place shown.

Days are 24 hours. Years are average Gregorian years of 365.2425 days, the figure usually quoted for 64-bit time limits; they are for scale, as real years have 365 or 366 days.

A duration is not a date. The same number read as a Unix time stamp in nanoseconds is a point in time counted from January 1, 1970; the note below the result shows that date when it is in range.

Powers of ten

Units in nanoseconds
UnitNanosecondsWritten
1 nanosecond110⁰
1 microsecond1,00010³
1 millisecond1,000,00010⁶
1 second1,000,000,00010⁹
1 minute60,000,000,0006 × 10¹⁰
1 hour3,600,000,000,0003.6 × 10¹²
1 day86,400,000,000,0008.64 × 10¹³
1 year (365.2425 days)31,556,952,000,000,0003.16 × 10¹⁶

Nanosecond counts are too large for ordinary floating-point numbers: a double can store integers exactly only up to 9,007,199,254,740,991 (about 104 days of nanoseconds). The converter uses exact big integers, so no digit is lost.

How long is a nanosecond?

Orders of magnitude in nanosecondsTypical delays from a CPU cycle to a blink, on a logarithmic scale.One CPU cycle (3 GHz)~0.3 nsL1 cache read~1 nsMain memory read~100 nsFast SSD read~100 µsRound trip in a data centre~0.5 msBlink of an eye~100–400 msNetwork round trip across an ocean~150 ms
Bars show the number of digits (a logarithmic scale); each extra step to the right is ten times longer. Values are typical orders of magnitude, not precise measurements.

Light travels about 30 centimetres in one nanosecond. That is why computers need nanosecond timing: signals inside a chip have only a few centimetres to travel per clock cycle.

64-bit limits

When counters overflow
CounterLargest valueRuns out
Signed 64-bit nanoseconds since 19709,223,372,036,854,775,8072262-04-11
Signed 64-bit microseconds since 19709.2 × 10¹⁸about 292,000 years
Signed 32-bit seconds since 19702,147,483,6472038-01-19

Free downloads

Plain files you can keep, print or open in a spreadsheet. They are the same figures used on this page.

Questions

Why do programs talk about the year 2262?

A signed 64-bit count of nanoseconds since 1970 runs out at 2^63 − 1 ns, which is April 11, 2262 at 23:47:16.854775807 UTC. Go’s time package and pandas, for example, have this limit.