Amdahl's law calculator
A program that is 95% parallel runs about 5.93 times faster on 8 processors, not 8 times, and can never pass 20 times however many you add. Use it to size a cluster or answer a naive N-times claim before buying hardware. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Parallel fraction
- 0.95
- Processors
- 8
- Serial fraction
- 0.05
- Speedup
- 5.9259259259
- Efficiency
- 0.7407407407
- Serial limit
- 20
Amdahl's law names the ceiling that leftover serial work puts on parallel speedup. If a fraction P of a program can run concurrently and the rest must stay sequential, adding processors never multiplies runtime by N. The theoretical speedup is one over one minus P plus P over N: the serial remainder stays in the denominator no matter how large N becomes. This Amdahl's law calculator accepts the parallelizable fraction and the processor count, then returns the speedup factor, the serial fraction, parallel efficiency, and the asymptotic serial limit one over one minus P whenever any serial work remains. The arithmetic is a closed-form identity, fully deterministic, with no simulation and no language model. Use it to size a cluster, argue against a naive N-times claim, or check a textbook speedup curve before you buy hardware.
What Amdahl's law measures and how the speedup factor is derived
Amdahl's law is Gene Amdahl's 1967 observation that leftover serial work bounds how much faster a whole program can run, no matter how many processors you apply to the parallel part. Write P for the fraction of single-processor wall-clock time that can run concurrently, and N for the processor count. The sequential fraction is one minus P.
After you divide the parallel work N ways, relative runtime becomes one minus P plus P over N, so the theoretical speedup S of N is the reciprocal of that sum: one divided by one minus P plus P over N. When P equals one, every cycle parallelizes and speedup equals N. When P equals zero, the job is purely serial and speedup stays one for every N.
Between those extremes, speedup grows with N but flattens toward the serial limit one over one minus P. That ceiling is the whole point of the law: a program that is only five percent serial can never exceed a twenty-times speedup, even on a million cores, because the serial five percent remains after the parallel ocean has been sliced infinitely thin. Parallel efficiency is speedup divided by N; it falls as N grows unless P is exactly one.
This calculator evaluates those identities directly. It is not a profiler, not a discrete-event simulator, and not Gustafson's scaled-speedup model, which asks a different question about growing the problem with the machine. If you know P from measurement or from a back-of-the-envelope split of hot loops versus setup, Amdahl's formula gives the theoretical speedup you should expect before cache effects, lock contention, or NUMA traffic make the real curve worse.
Where an Amdahl's law calculator earns its keep
Use the browser tool when you are sizing a cluster, reviewing a performance claim that speedup will track core count, or walking a class through why ninety-five percent parallel still tops out at twenty times. Sweep N upward until speedup approaches the serial limit, then stop buying cores you cannot harvest.
Contrast the result with Gustafson's law if your workload grows with the machine; Amdahl holds the problem size fixed, which is the conservative bound for batch jobs, compilers, and scientific kernels that do not magically enlarge when you add sockets. Results are fully deterministic: the same P and N always yield the same speedup vector, so you can pin examples in tests and lesson materials. There is no language model, no external profiling service, and no randomness.
What you can do with it
Cluster and core-count sizing
Plug in the measured parallelizable fraction and sweep processor counts until theoretical speedup approaches the serial limit, then stop buying cores you cannot harvest.
Performance-review reality checks
Replace a naive N-times speedup claim with Amdahl's bound so architecture reviews show the serial remainder instead of an unbounded linear curve.
FAQ
What happens if the parallelizable fraction is outside 0 to 1?
P is a fraction of single-processor time, so values below 0 or above 1 are rejected and not billed. Send 0.95 for 95 percent, not 95.
How is this different from Gustafson's law?
Amdahl holds problem size fixed and asks how much faster the same job runs on N processors. Gustafson lets the problem grow with the machine.
What is the formula behind Amdahl's law?
Speedup is one divided by the serial fraction plus the parallel fraction shared among the processors. With 0.95 parallel and 8 processors, that is one over 0.05 plus 0.95 divided by 8, about 5.93.
What does parallel efficiency tell me?
It is the speedup divided by the number of processors. At 5.93 times on 8 processors, efficiency is about 0.74, so each processor delivers roughly three quarters of its ideal share, and that share keeps falling as you add more.
Will my real program reach this speedup?
Usually not. The result is a theoretical ceiling for a fixed workload. Cache effects, lock contention and memory traffic make real curves worse, so treat it as the best case to compare with your own measurements.
Related tools
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/dev/amdahls-law \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"parallel_fraction":0.95,"processors":8}'const res = await fetch("https://api.kit.forhosting.com/dev/amdahls-law", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"parallel_fraction": 0.95,
"processors": 8
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/amdahls-law",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"parallel_fraction": 0.95,
"processors": 8
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/amdahls-law", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"parallel_fraction":0.95,"processors":8}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"parallel_fraction":0.95,"processors":8}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/amdahls-law", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"parallel_fraction": 0.95,
"processors": 8
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.amdahls_law",
"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.
Limits
max_processors | 1000000000000 |
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. |
Technical notes
Input contract, response shape, and error behaviour
After validation the engine computes serial fraction as one minus P, the Amdahl denominator as that serial remainder plus P over N, speedup as one over the denominator, and efficiency as speedup over N. When P equals one the serial limit is unbounded, so that key is omitted rather than emitted as null. Example: P equals 0.95 and N equals eight yields speedup about 5.93, efficiency about 0.74, and a serial limit of twenty. This is a theoretical-speedup oracle under Amdahl's fixed-workload model, not a measurement of your binary and not a Gustafson scaled-speedup calculator. POST a JSON body with two required fields. parallel_fraction is the parallelizable fraction P, a finite number from zero to one inclusive; send 0.95 for ninety-five percent, never ninety-five. Aliases p, parallelizable_fraction, and f are accepted. processors is the processor count N, an integer from one through one trillion. Aliases n, cores, and n_processors are accepted. Missing fields, non-finite values, non-integer processor counts, N below one, N above the published maximum, and a parallelizable fraction outside zero to one fail with invalid_input naming the field and are not billed. The JSON body echoes parallel_fraction and processors, then returns serial_fraction, speedup, efficiency, and a formula string restating S of N equals one over one minus P plus P over N. When P is strictly less than one it also returns serial_limit, the asymptotic bound one over one minus P.
Where an Amdahl's law calculator earns its keep
Each successful request is one billable item at $0.002; failed validation does not consume balance. The published processor range keeps the closed-form evaluation inside ordinary IEEE-754 doubles while covering every practical machine you would size by hand. Wire the endpoint into parallel-computing tutorials, capacity planners, architecture reviews, or coding-interview oracles where you prefer the exact Amdahl identity over anecdotal speedup tables that hide the serial remainder.
Integration use cases
Teaching parallel computing
Give students a deterministic oracle for S(N)=1/((1-P)+P/N), including the P=0, P=1, and serial-limit cases, without standing up a profiler.
Technical questions
What is the Amdahl's law formula for speedup?
Send parallel_fraction P in [0, 1] and processors N as an integer ≥ 1. The API returns S(N)=1/((1-P)+P/N), plus serial fraction 1-P and efficiency S/N.
What is the serial limit returned by the calculator?
serial_limit is 1/(1-P), the maximum speedup as N goes to infinity. It is omitted when P=1 because a fully parallel program has no serial bound.
What does the Amdahl's law calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.