Server Clock Offset Calculator
Measure the clock offset and round-trip time between your browser and a server using sequential timed requests.
Input
Output
Readme
What is clock offset?
Clock offset is the difference between your local system clock and the true reference time — in this case, the server's clock. Even though operating systems try to keep clocks synchronized using NTP (Network Time Protocol), small discrepancies of a few milliseconds to several seconds are common, especially on devices that haven't synced recently or are behind strict firewalls.
Understanding clock offset matters in distributed systems, real-time applications, authentication tokens (like TOTP), scheduled tasks, and any scenario where your client and a remote server need to agree on the current time. A large offset can cause token validation failures, missed deadlines, or incorrect timestamps in logs.
Tool description
This tool measures the clock offset between your browser and the server using a WebSocket-based timing protocol. It sends a series of round-trip probes, records the latency of each, and uses the median round-trip time (RTT) to calculate how far ahead or behind your local clock is relative to the server. After measurement, the tool displays a live running estimate of server time alongside your local time so you can observe the difference in real time.
How it works
The tool opens a WebSocket connection to the server and exchanges a series of timestamped ping/pong messages. For each message:
- The client records the send time, receives the server's timestamp in the reply, and records the receive time.
- Half of the round-trip time is used as an estimate of the one-way network delay.
- The clock offset is computed as:
serverTime − clientTime − (RTT / 2).
Ten samples are collected and the median RTT is used — not the mean — to reduce the influence of outlier spikes caused by GC pauses or transient network jitter. The resulting clock offset indicates how many milliseconds your local clock leads (positive) or lags (negative) the server.
Features
- WebSocket-based measurement — uses real-time bidirectional communication for accurate timing probes without HTTP overhead
- Median RTT filtering — collects 10 samples and uses the median to eliminate jitter and outlier spikes
- Live clock display — shows a continuously updating estimated server time and your local time side by side after measurement