F Test for Two Variances Calculator
The F test for two variances evaluates whether two independent populations can reasonably be treated as having the same variance.
Run — free
Enter two arrays of numeric observations and the calculator returns the F statistic, defined as the first sample variance divided by the second, together with a two-sided p-value. The calculation uses unbiased sample variances and the exact F distribution for the corresponding sample sizes. It is deterministic, uses no simulation or network request, and requires at least two observations in each group.
What the two-variance F test measures
The test starts with the null hypothesis that the two underlying population variances are equal. It computes an unbiased sample variance for each group, using a denominator of sample size minus one, and divides the first variance by the second. That ratio is the F statistic. A value near one means the observed spreads are similar, while a value far above one means the first group is more variable and a value far below one means the second is more variable. The ordering matters for the reported statistic: swapping the arrays produces the reciprocal ratio and exchanges the two degrees of freedom. The two-sided p-value, however, evaluates unusually large discrepancies in either direction. It is twice the smaller tail probability under the F distribution, capped at one. A small p-value indicates that a variance ratio at least this extreme would be unusual if both populations truly had the same variance. It does not state the probability that their variances are equal, and it does not describe how important the difference is in practical terms.
How to enter data and interpret the result
Provide each sample as an array containing at least two finite numbers. The arrays may have different lengths, and their observation order does not affect the calculation. Each group is summarized independently with a numerically stable one-pass variance algorithm. The returned F statistic is always the variance of group1 divided by the variance of group2, so retain a consistent group order when comparing results across reports. The p-value is two-sided and already accounts for a discrepancy in either direction; do not double it again. Before examining the data, choose a significance level appropriate to the analysis, such as a threshold specified by a study plan or quality procedure. A p-value below that threshold is evidence against equal population variances under the model assumptions. A larger value means the data do not provide strong evidence of unequal variances, but it does not prove equality. Report sample sizes, sample variances, the group ordering, the F statistic, and the p-value when documenting the analysis, and consider a confidence interval or a robust spread comparison when practical magnitude matters.
Assumptions and important limitations
The classical F test is sensitive to its assumptions. Observations should be independent within and between groups, the samples should represent the populations to which the conclusion is applied, and both underlying populations should be approximately normal. Skewness, heavy tails, or outliers can substantially change sample variances and inflate or suppress the test statistic, especially with small samples. Inspect the data distribution rather than treating the p-value as a standalone verdict. For clearly non-normal measurements, consider a more robust procedure such as Levene's test or the Brown–Forsythe test. The calculator rejects a group with fewer than two values because a sample variance cannot then be estimated. It also rejects nonnumeric or non-finite observations, arrays above the declared size limit, and groups with zero or non-finite sample variance because the ordinary continuous F ratio and its p-value are not well defined for those inputs. Statistical significance does not establish causation, measurement quality, or business importance. Use the result as one diagnostic within a documented analysis, not as an automatic decision detached from sampling design and subject-matter context.
What you can do with it
Check a modeling assumption
Compare group variability before selecting a pooled-variance analysis that assumes equal population variances.
Compare process consistency
Test whether measurements from two production lines show evidence of different variance.
Reproduce a reported test
Recalculate the F statistic and two-sided p-value directly from two published or audited samples.
FAQ
Is the p-value one-sided or two-sided?
It is two-sided and counts unusually different variances in either direction.
Which variance is in the numerator?
The sample variance of group1 is divided by the sample variance of group2, so swapping the groups gives the reciprocal F statistic.
Why does each group need at least two values?
Estimating an unbiased sample variance requires at least one degree of freedom, which means at least two observations.
Why is a constant group rejected?
A constant group has zero sample variance, making the ordinary continuous F ratio or its tail probability undefined for this calculator.
Does a large p-value prove equal variances?
No. It only means the observed samples do not provide strong evidence against equality under the F-test assumptions.
What does an API calculation cost?
Each API request costs $0.002. The same deterministic analytic logic powers the browser calculation.
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/f-test-variances \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"group1":[10,12,9,11,13,10],"group2":[8,15,7,16,9,14]}'const res = await fetch("https://api.kit.forhosting.com/stat/f-test-variances", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"group1": [
10,
12,
9,
11,
13,
10
],
"group2": [
8,
15,
7,
16,
9,
14
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/f-test-variances",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"group1": [
10,
12,
9,
11,
13,
10
],
"group2": [
8,
15,
7,
16,
9,
14
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/f-test-variances", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"group1":[10,12,9,11,13,10],"group2":[8,15,7,16,9,14]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"group1":[10,12,9,11,13,10],"group2":[8,15,7,16,9,14]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/f-test-variances", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"group1": [
10,
12,
9,
11,
13,
10
],
"group2": [
8,
15,
7,
16,
9,
14
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.f_test_variances",
"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_items_per_group | 100000 |
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. |