Skip to content

Nanoseconds to Human Readable

Paste any number of nanoseconds and instantly see the human-readable duration — from days down to individual nanoseconds — plus every common unit conversion.

Why nanoseconds are hard to read

One billion nanoseconds is one second — a ratio large enough that nanosecond values look unreadable at a glance. When a Go benchmark prints BenchmarkFoo-8 5000000 250 ns/op, the per-operation time is easy to interpret. But when a profiler reports total elapsed time as 1_427_892_345 ns, it takes mental arithmetic to land on “about 1.4 seconds.”

Paste the value here and you see the breakdown instantly. The tool also shows every common unit equivalent — µs, ms, seconds, minutes — so you can copy whichever form your next step needs. Working with coarser microsecond values instead? That page does the same conversion one level up.

Frequently asked questions

What is a nanosecond?

A nanosecond (ns) is one billionth of a second. Light travels about 30 centimetres (one foot) in one nanosecond, which is why chip designers care about nanosecond timing at the hardware level. In software, nanoseconds appear wherever sub-microsecond precision is needed.

Where do nanosecond values appear in software?

Go's time.Duration type stores durations as int64 nanoseconds — so time.Sleep(500 * time.Millisecond) is internally 500,000,000 ns. Rust's std::time::Instant and Duration use nanosecond precision. Linux clock_gettime(CLOCK_MONOTONIC) returns seconds + nanoseconds. Many benchmarking frameworks (Go testing, Criterion for Rust) also report per-iteration times in nanoseconds.

How many nanoseconds are in a second?

1,000,000,000 (one billion) nanoseconds. The full chain: 1 second = 1,000 milliseconds = 1,000,000 microseconds = 1,000,000,000 nanoseconds.

How do I convert nanoseconds in Go?

Use the time package: d := time.Duration(ns) * time.Nanosecond, then d.String() prints a human-readable form like "1.5s" or "300ms". For arithmetic, time.Duration values are already in nanoseconds, so you can divide directly: seconds := ns / int64(time.Second).

Why do Go benchmarks print ns/op?

Go's testing package reports benchmark throughput as nanoseconds per operation (ns/op) because Go's time.Duration is nanosecond-native and the values are small enough to be meaningful at that precision. A result of 250 ns/op means each loop iteration took a quarter of a microsecond.

Related tools

Smart paste

Paste any timestamp or date, or search for a tool