Clock frequency and period calculator
A digital clock connects frequency, period, and elapsed cycles. Enter a frequency such as 100 MHz to find the duration of one cycle, or enter a period such as 10 ns to recover the clock frequency.
Run — free
You can also supply an interval to calculate how many cycles occur during that time. The calculator presents results in practical engineering units, making it useful for processor clocks, buses, FPGA timing, microcontroller peripherals, test equipment, and digital communication systems without requiring repeated manual unit conversions.
Convert clock frequency into period
Clock frequency tells you how many cycles occur each second, while period tells you how long one cycle lasts. They are reciprocals: period equals one divided by frequency. For example, a 100 MHz clock performs 100 million cycles per second, so each cycle lasts 10 nanoseconds. Choose Hz, kHz, MHz, or GHz with the number you already have; the calculator normalizes it to hertz and returns the same clock in several frequency scales alongside seconds, milliseconds, microseconds, nanoseconds, and picoseconds per cycle. These parallel results help prevent a common engineering mistake: calculating the reciprocal correctly but attaching the wrong metric prefix. Use the period when reviewing setup and hold budgets, estimating how much combinational logic may fit between registers, configuring an oscilloscope timebase, or comparing a peripheral timing requirement with the system clock. Frequency must be positive because a zero-frequency clock has no finite period, and a negative frequency is not meaningful for this digital-clock calculation. The result uses stable significant-digit rounding so repeated API and browser calculations remain consistent.
Convert a measured or specified period into frequency
Sometimes a data sheet, timing diagram, logic analyzer, or oscilloscope gives the cycle duration rather than the clock rate. In that direction, frequency equals one divided by period. Enter the period and select seconds, milliseconds, microseconds, nanoseconds, or picoseconds. A 20 ns period, for instance, corresponds to 50 MHz. The output includes the normalized hertz value plus kHz, MHz, and GHz representations, so you can compare it directly with clock-generator settings or device limits. Provide either frequency or period, never both. Requiring a single source value avoids silently choosing between contradictory inputs and makes automated calls easier to audit. When using a measured period, remember that this calculator assumes the value represents one complete clock cycle. A pulse width is not necessarily a period: for a clock with a non-fifty-percent duty cycle, high time and low time differ even though their sum is the period. Likewise, protocol bit time may span one or several reference-clock cycles. Check what the measurement represents before treating its reciprocal as the hardware clock frequency.
Calculate cycles over an elapsed interval
Add an optional time interval when you need more than the reciprocal conversion. The calculator multiplies normalized frequency in hertz by interval duration in seconds to obtain the number of cycles. This is useful for translating a timeout into timer ticks, estimating how many processor cycles are available for a routine, checking the clocks inside a communication frame, or converting a simulation duration into expected edges. The `cycles` result may contain a fractional value when the interval ends partway through a cycle. The separate `complete_cycles` result is always rounded down, because only cycles that finish within the interval count as complete. For example, 2.5 cycles describes elapsed phase accurately, but only two whole cycles have completed. An interval of zero is valid and returns zero cycles. Select the interval unit independently from the period unit, which allows combinations such as a clock in MHz and a timeout in microseconds without preliminary conversion. This calculation describes an ideal constant clock. Real oscillators have tolerance, jitter, drift, and possible clock gating; incorporate those effects separately when building worst-case timing margins or safety-critical timeout limits.
What you can do with it
Review FPGA timing
Convert a target clock rate into the nanoseconds available for each synchronous logic stage.
Configure timer counts
Find how many input-clock cycles occur during a requested microsecond or millisecond timeout.
Interpret measurements
Turn an oscilloscope or logic-analyzer period measurement into a familiar MHz or GHz clock rate.
FAQ
What does an API calculation cost?
Each API request costs $0.002; the calculator can also run free in the browser.
What formula converts frequency to period?
Period in seconds equals 1 divided by frequency in hertz.
Can I provide both frequency and period?
No. Provide exactly one so the calculation has one unambiguous source value.
Why can cycles contain a fraction?
The selected interval may end during a cycle. Use complete_cycles when only fully finished cycles count.
Does this account for clock jitter or tolerance?
No. It calculates an ideal constant clock; apply component tolerance, jitter, drift, and gating margins separately.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/elec/clock-period \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"frequency":100,"frequency_unit":"MHz"}'const res = await fetch("https://api.kit.forhosting.com/elec/clock-period", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"frequency": 100,
"frequency_unit": "MHz"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/elec/clock-period",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"frequency": 100,
"frequency_unit": "MHz"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/elec/clock-period", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"frequency":100,"frequency_unit":"MHz"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"frequency":100,"frequency_unit":"MHz"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/elec/clock-period", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"frequency": 100,
"frequency_unit": "MHz"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "elec.clock_period",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |