What Is Network Time Protocol?

Network Time Protocol, usually shortened to NTP, is a set of methods computers use to synchronize their clocks with time references over a network.

Network Time Protocol: Time source, Reference clock; Network, Exchange messages; Device clock, Synchronize time.

Why computers need synchronization

A computer's clock is driven by hardware that can run slightly fast or slow. Even a small error grows over time. Devices on the same network may also be set differently. That can make logs appear out of order, cause authentication failures, or make it difficult to compare when events occurred.

NTP lets a device ask a time server for a reference and estimate how far its own clock differs. It can repeat these checks and gradually adjust the local clock. A device may use several sources so it can identify a server that is unreachable or reporting an inconsistent time.

Network delay affects the answer

A time request takes time to travel to the server and back. The network path may be delayed or asymmetric, so the client cannot simply treat the reply's arrival time as the exact current time. NTP uses timing information from exchanges to estimate network delay and clock offset. Better-connected or specialized systems can achieve higher accuracy than a device on a busy or unreliable network.

Accuracy depends on the whole chain: the reference clock, server configuration, network conditions, client implementation and hardware. Seeing a timestamp with fine decimal precision does not prove that the local machine is synchronized to the same precision.

What happens when the clock is adjusted?

Operating systems may correct a clock gradually or step it forward or backward, depending on the size of the error and platform policy. Since wall-clock time can be adjusted, programs should not rely on it to measure short durations. A monotonic clock is designed to move steadily and is a better tool for timeouts and performance measurements.

Clock corrections also affect logs. Two machines may record events with slightly different timestamps even when they communicate closely. If precise ordering matters, systems can include sequence numbers, causal metadata or other ordering mechanisms rather than relying only on wall-clock values.

Time synchronization is not a time zone

NTP helps answer “what instant is it?” It does not decide how that instant should appear on a user's local clock. A computer applies its time-zone setting and daylight-saving rules separately when it displays a local date and time.

The RFC Editor's NTPv4 specification describes the protocol architecture and synchronization algorithms.

Keep device time synchronization enabled for reliable everyday use. For high-precision scientific or financial systems, follow the timing requirements and trusted infrastructure specified by that domain. Read What Is Timestamp Precision? or learn about the reference itself in What Is UTC?

How the offset is estimated

An NTP exchange records four timestamps: t1 when the client sends a request, t2 when the server receives it, t3 when the server replies and t4 when the reply arrives. RFC 5905 combines them like this:

  • offset = ((t2 − t1) + (t3 − t4)) / 2
  • round-trip delay = (t4 − t1) − (t3 − t2)

With t1 = 100.000 s, t2 = 100.120 s, t3 = 100.121 s and t4 = 100.041 s (client and server clocks), the offset is (0.120 + 0.080) / 2 = 0.100 s. The client is 100 ms behind. The delay is 0.041 − 0.001 = 0.040 s. The formula assumes the trip out and the trip back take equally long. When they do not, the error is at most half the round-trip delay, which is why nearby servers give better results.

Sequence diagram of an NTP exchange: the client sends at t1, the server receives at t2 and replies at t3, and the client receives the reply at t4. Offset is ((t2 − t1) + (t3 − t4)) / 2 and delay is (t4 − t1) − (t3 − t2).
The four timestamps NTP uses to estimate clock offset and network delay (RFC 5905).

Strata and everyday devices

NTP servers are arranged in strata. A stratum 1 server takes its time from a reference clock such as GNSS or an atomic standard, a stratum 2 server asks stratum 1 servers, and so on. Phones, laptops and cloud machines usually query public services such as the NTP Pool or NIST's time servers, or a server run by their organisation.

Small errors are corrected by slewing: the clock runs slightly fast or slow until it catches up, so time never goes backwards. Large errors, such as after a long time switched off, are corrected by stepping the clock in one jump. Programs that measure durations should use a monotonic clock, which is never stepped.

The tools on this site do not contact an NTP server. They read your device clock, so if that clock is wrong, the "now" values on the home page are wrong by the same amount.

Common questions

Can I trust a web page's clock?

A page that reads Date.now() shows the device's time, which is normally kept in sync by the operating system. A page that asks its own server for the time can show that server's time instead, but it still has to allow for network delay.

What is the difference between NTP and SNTP?

SNTP is a simpler subset of the same protocol. It suits clients that only need to set their clock occasionally, without the filtering and server selection full NTP does.

Sources and further reading