False positive rate calculator
5 false alarms among 100 truly negative cases give a false positive rate of 0.05: 5 false positives divided by 5 plus 95 true negatives. Use it for screening tests, spam filters or the horizontal axis of a ROC curve. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- False positives
- 5
- True negatives
- 95
- Condition negatives
- 100
- False positive rate
- 0.05
The false positive rate, also called fall-out or the Type I error rate of a binary classifier, is the share of actual negatives that were incorrectly flagged as positive. You enter two non-negative counts — false positives and true negatives — and this calculator returns the rate as a decimal: FPR equals FP divided by FP plus TN. An FPR of 0.05 means five percent of the truly negative cases were false alarms.
What the false positive rate measures and how the two counts combine
The false positive rate of a binary classifier is the fraction of actual negatives that the system incorrectly labeled as positive. In the language of a two-by-two confusion matrix, those actual negatives split into two cells: false positives, the false alarms, and true negatives, the cases the system correctly left alone. Their sum is the number of condition-negative cases, and the false positive rate is false positives divided by that sum: FPR equals FP over FP plus TN.
The same quantity is called fall-out in information-retrieval papers and is one minus specificity, because specificity is TN over FP plus TN. An FPR of zero means the classifier never raised a false alarm among the known negatives. An FPR of one means every actual negative was flagged.
The definition is only a ratio of two counts, so it does not depend on how many true positives or false negatives you observed: those cells belong to sensitivity, precision, and other derived scores. This capability therefore asks only for the two counts that appear in the denominator of FPR. It does not invent confidence intervals, ROC points, or p-values.
Where the false positive rate matters most
Machine-learning evaluation scripts need a deterministic false-positive-rate calculator that never silently returns Infinity when a hold-out set has no actual negatives. Medical and screening tutorials use FPR to explain the cost of a sensitive test: each false positive is a healthy person sent for follow-up, and the rate is those people divided by all the truly healthy people who were tested.
Spam, fraud, and moderation queues watch this number because each false alarm consumes a human review slot, and they want the decimal, not a percentage string, so they can plot it next to a budget. Failed validation does not consume balance. Keep the two counts non-negative, refuse a negative true-negative cell, and you get a reproducible FPR for homework, CI, and production reports without standing up a statistics stack of your own.
What you can do with it
Classifier evaluation and ROC notes
Turn a hold-out pair of FP and TN counts into the decimal false positive rate used as the x-axis of a ROC curve.
Screening and medical-test teaching
Show how many healthy people a test would send for follow-up by dividing false positives by all actual negatives.
Homework and LMS auto-grading
Mark FPR items with a deterministic oracle that rejects a negative true-negative count and never invents Infinity.
FAQ
What happens if the true-negative count is negative?
A negative true-negative count is not a valid cell of a confusion matrix, so no rate is invented. These failures are not billed.
Is the result a percentage or a decimal?
A decimal on the unit interval. Five false positives and ninety-five true negatives return 0.05, not 5. Multiply by 100 only if you need a percent for display.
How does the false positive rate relate to specificity?
They add up to one. Specificity is the true negatives divided by all actual negatives, so the false positive rate equals one minus specificity. A rate of 0.05 means 95 % of the negatives were correctly left alone.
Why don't I need true positives or false negatives?
Because the false positive rate only looks at the cases that are truly negative. True positives and false negatives belong to other scores, such as sensitivity and precision, so they do not change this rate.
What happens if both counts are zero?
The calculation is refused. With no false positives and no true negatives there are no truly negative cases at all, so the rate is undefined rather than zero.
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/stat/false-positive \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"false_positives":5,"true_negatives":95}'const res = await fetch("https://api.kit.forhosting.com/stat/false-positive", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"false_positives": 5,
"true_negatives": 95
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/false-positive",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"false_positives": 5,
"true_negatives": 95
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/false-positive", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"false_positives":5,"true_negatives":95}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"false_positives":5,"true_negatives":95}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/false-positive", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"false_positives": 5,
"true_negatives": 95
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.false_positive",
"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. |
Technical notes
When the true-negative count is negative the task fails with invalid_input instead of inventing a rate from an impossible count. When both counts are zero there are no condition-negative cases and the rate is undefined, so the call fails cleanly. Successful API calls cost $0.002; bad input is not billed.
What the false positive rate measures and how the two counts combine
An FPR of 0.05 means five of every hundred truly negative cases were false positives, which is the usual decimal form this endpoint returns rather than a percentage. When the true-negative count is negative the arithmetic would describe an impossible table, so the task fails with invalid_input. When both counts are zero there is no condition-negative population and the ratio is undefined, so the call fails instead of returning NaN or Infinity that would break JSON clients.
Input contract, response shape, and error behaviour
Both counts must be greater than or equal to zero. The published contract is explicit that a negative true-negative count is rejected, because a negative cell is not a count and would flip the meaning of the rate. A negative false-positive count is rejected for the same reason. POST a JSON body with two required finite numbers: false_positives, the number of actual negatives predicted as positive, and true_negatives, the number of actual negatives predicted as negative. Aliases fp and FP are accepted for the first field; tn and TN are accepted for the second, so notebooks and typed forms can reuse the names they already have. Each field may arrive as a JSON number or as a numeric string; non-finite values, missing fields, empty strings, and non-numeric types fail with invalid_input naming the field. The sum of the two counts must be strictly greater than zero: a table with no actual negatives makes FPR undefined, and the error message states that so graders and API clients can distinguish an empty negative class from other bad input. On success the body echoes both counts, returns condition_negatives as their sum, returns false_positive_rate as a cleaned decimal, and includes a short formula string restating FPR equals FP over FP plus TN. Example: five false positives and ninety-five true negatives yield condition_negatives of one hundred and a false_positive_rate of 0.05. Failed validation does not consume prepaid balance. Pair this endpoint with your own software for ROC curves or Wilson intervals if you need inference beyond the point estimate; this capability is intentionally a pure analytic FPR from two counts.
Where a false-positive-rate API earns its keep
Product dashboards that already store confusion counts can call the API from a pipeline and store only the decimal rate, which is cheap to trend over time.
Technical questions
How do I calculate the false positive rate from counts?
Send false_positives (FP) and true_negatives (TN). The API returns false_positive_rate = FP / (FP + TN) as a decimal, plus the condition-negative total FP + TN.
What if both counts are zero?
False positive rate is undefined when there are no actual negatives (FP + TN = 0). The calculator returns invalid_input instead of Infinity or NaN.
What does the false positive rate calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.