Nanoseconds Converter
Exact conversions for durations of any size, from nanoseconds up to centuries.
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.
How to use this converter
- 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
Choose its unit. Nanoseconds by default; microseconds, milliseconds, seconds, minutes, hours and days also work.
- 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
| Unit | Nanoseconds | Written |
|---|---|---|
| 1 nanosecond | 1 | 10⁰ |
| 1 microsecond | 1,000 | 10³ |
| 1 millisecond | 1,000,000 | 10⁶ |
| 1 second | 1,000,000,000 | 10⁹ |
| 1 minute | 60,000,000,000 | 6 × 10¹⁰ |
| 1 hour | 3,600,000,000,000 | 3.6 × 10¹² |
| 1 day | 86,400,000,000,000 | 8.64 × 10¹³ |
| 1 year (365.2425 days) | 31,556,952,000,000,000 | 3.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?
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
| Counter | Largest value | Runs out |
|---|---|---|
| Signed 64-bit nanoseconds since 1970 | 9,223,372,036,854,775,807 | 2262-04-11 |
| Signed 64-bit microseconds since 1970 | 9.2 × 10¹⁸ | about 292,000 years |
| Signed 32-bit seconds since 1970 | 2,147,483,647 | 2038-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.