Skip to content
Statculator
Hypothesis Tests

Levene’s Test Calculator

Free Levene’s test calculator for equality of variances across 2 to 10 groups. Mean or median (Brown–Forsythe) centre, W, df, p-value and every step.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
Data for each group
n = 10
n = 10
n = 10

One box per group (2 to 10 groups). Groups can have different sizes; each needs at least 2 values.

The median is the safest choice for skewed data and is the default in SciPy and R’s car package.

Usually 0.05 or 0.01.

Levene’s test needs independent groups but not normal data. It tests spread only; it says nothing about whether the group means differ.

Results

W statistic
6.6576
Brown–Forsythe test (median-centred Levene)
p-value
0.0045
df = (2, 27)

Reject H₀ at α = 0.05

p = 0.0045 ≤ 0.05. At the 5% level there is sufficient evidence that the group variances differ.

Numerator df, k − 1
2
Denominator df, N − k
27
Critical F (α = 0.05)
3.3541
Groups, k
3
Total observations, N
30
Overall mean deviation, Z̄
2.8667
Largest variance
Group 2 (33.6111)
Smallest variance
Group 1 (3.3333)
Variance ratio, largest / smallest
10.0833

Interpretation: Group 2 is the most variable group (s² = 33.6111) and Group 1 the least (s² = 3.3333), a ratio of 10.08. Differences in spread this large would be unlikely if the population variances were equal. Treat the equal-variance assumption as violated: compare the means with Welch’s ANOVA rather than the classic one-way ANOVA, and compare any two groups with Welch’s t-test.

f distribution curve with the shaded probability region, markers at W = 6.658W = 6.65801234567F distribution, df = (2, 27)
Shaded area: rejection region at the chosen α. Dashed line: your test statistic.

Group summary

GroupnCentre (median)Mean absolute deviation, Z̄ᵢVariance, s²SD, s
Group 110241.43.33331.8257
Group 210254.733.61115.7975
Group 31024.52.59.16673.0277
All groups302.8667

Z̄ᵢ is the average distance of a group’s values from its median. The test compares these averages, not the variances directly.

ANOVA on the absolute deviations

SourceSSdfMSWp-value
Between groups56.4667228.23336.65760.0045
Within groups114.5274.2407
Total170.966729

Absolute deviations, |x − median|

#Group 1Group 2Group 3
1173.5
2142.5
3210.5
4284.5
5054.5
6321.5
73101.5
8163.5
9032.5
10110.5

Step-by-step solution

  1. 1

    State the hypotheses

    This is a right-tailed test.

    H₀: σ₁² = σ₂² = σ₃²
    H₁: at least one variance differs
  2. 2

    Choose the significance level

    α = 0.05
  3. 3

    Find each group’s median

    The median is used as the centre (Brown–Forsythe version), which keeps the test reliable for skewed data.

    Group 1: n = 10, x̃ = 24
    Group 2: n = 10, x̃ = 25
    Group 3: n = 10, x̃ = 24.5
  4. 4

    Convert each value to an absolute deviation

    Replace every observation by its distance from its own group’s median. A group with more spread has larger distances on average.

    Zᵢⱼ = |xᵢⱼ − x̃ᵢ|
    Group 1: 1, 1, 2, 2, 0, 3, 3, 1, 0, 1 → Z̄₁ = 1.4
    Group 2: 7, 4, 1, 8, 5, 2, 10, 6, 3, 1 → Z̄₂ = 4.7
    Group 3: 3.5, 2.5, 0.5, 4.5, 4.5, 1.5, 1.5, 3.5, 2.5, 0.5 → Z̄₃ = 2.5
  5. 5

    Find the overall mean deviation

    Z̄ = Σ nᵢZ̄ᵢ / N = 86 / 30 = 2.8667
  6. 6

    Run a one-way ANOVA on the deviations

    Levene’s W is the ordinary ANOVA F statistic computed on the Zᵢⱼ instead of on the raw data.

    SS between = Σ nᵢ(Z̄ᵢ − Z̄)² = 10(1.4 − 2.8667)² + 10(4.7 − 2.8667)² + 10(2.5 − 2.8667)² = 56.4667
    SS within = Σ Σ (Zᵢⱼ − Z̄ᵢ)² = 114.5
    MS between = 56.4667 / 2 = 28.2333; MS within = 114.5 / 27 = 4.2407
  7. 7

    Calculate the W statistic

    W = [(N − k) / (k − 1)] × Σ nᵢ(Z̄ᵢ − Z̄)² / Σ Σ (Zᵢⱼ − Z̄ᵢ)²
    W = MS between / MS within = 28.2333 / 4.2407 = 6.6576
  8. 8

    Find the p-value

    Under H₀, W follows an F distribution with df = (k − 1, N − k) = (2, 27). Only large values of W count against equal variances.

    p = P(W ≥ 6.6576) = 0.0045
  9. 9

    Find the critical value

    Critical value: 3.3541
    Reject H₀ if W ≥ 3.3541
  10. 10

    Decision: reject H₀

    At the 5% level there is sufficient evidence that the group variances differ.

    p = 0.0045 ≤ α = 0.05

What is a Levene’s Test Calculator?

Levene’s test of equality of variances checks whether two or more groups have the same population variance, the homogeneity of variance assumption behind the t-test and ANOVA. Each value is replaced by its absolute distance from its group’s centre (the mean, or the median in the Brown–Forsythe version), and a one-way ANOVA is run on those distances. The statistic W follows an F distribution with k − 1 and N − k degrees of freedom; if p ≤ α, the variances differ.

What the Levene’s Test Calculator does

Paste the raw values for 2 to 10 groups and choose the centre: median (Brown–Forsythe, the default), mean (Levene’s original test, the one SPSS prints) or a trimmed mean. The calculator returns the W statistic, both degrees of freedom, the p-value and the critical F, a table of each group’s size, centre, mean absolute deviation and variance, the ANOVA table computed on the deviations, and every step of the working.

Run it before a pooled t-test or a one-way ANOVA, both of which assume equal variances, or whenever consistency itself is the question: which machine, method or supplier is more variable. Unlike the classical F-test for two variances, Levene’s test does not depend on the data being normal, and it handles any number of groups.

How to use the Levene’s Test Calculator

  1. Type or paste each group’s values into its own box under Data for each group; use Add group for a third or later group.
  2. Pick the Centre used for the deviations. Keep Median unless you need to match software that centres on the mean, such as SPSS.
  3. For a trimmed mean, set Trim from each end (5% matches SciPy’s default).
  4. Set the significance level α and read W, the p-value and the decision. The step-by-step solution lists every absolute deviation and the ANOVA built from them.

How to interpret Levene’s test results

The hypotheses are H₀: σ₁² = σ₂² = … = σₖ² (all groups have equal variances, the homogeneity of variance assumption holds) and H₁: at least one variance differs. The test is right-tailed, so only a large W counts against H₀.

ResultWhat it meansWhat to do next
p ≤ α (for example p = 0.004)The variances differ; homogeneity of variance is violatedUse Welch’s t-test (2 groups) or Welch’s ANOVA with Games–Howell (3+ groups)
p > α (for example p = 0.41)No evidence that the variances differThe pooled t-test or classic one-way ANOVA is reasonable; check the variance ratio too
p > α with fewer than about 10 values per groupThe test had little power; equal variances are not shownPrefer Welch’s methods, which do not need equal variances

How to report Levene’s test (APA style)

Report the centre, W as an F statistic with both degrees of freedom, and the p-value. For the clinic example below: Levene’s test based on the median showed that the variance of waiting times differed across the three clinics, F(2, 27) = 6.66, p = .004, so Welch’s ANOVA was used to compare the means.

For a non-significant result: Levene’s test showed no evidence of unequal variances, F(2, 57) = 0.91, p = .41, so the homogeneity of variance assumption was retained. Give the p-value to two or three decimals, or write p < .001 for very small values.

Levene’s test formula: how W is calculated

Levene’s test is calculated in three moves: turn every value into its absolute distance from its group’s centre, run a one-way ANOVA on those distances, and compare the resulting W with an F distribution. With k groups, nᵢ values in group i and N values in total:

Absolute deviations
Zᵢⱼ = |xᵢⱼ − cᵢ|, cᵢ = median, mean or trimmed mean of group i
Test statistic
W = [(N − k) / (k − 1)] × Σ nᵢ(Z̄ᵢ − Z̄)² / Σ Σ (Zᵢⱼ − Z̄ᵢ)²
Degrees of freedom
df₁ = k − 1, df₂ = N − k
p-value
p = P(F(df₁, df₂) ≥ W)
Formula symbols
SymbolMeaning
xᵢⱼobservation j in group i
cᵢcentre of group i
Z̄ᵢmean of the absolute deviations in group i
Z̄mean of all N absolute deviations
k, Nnumber of groups and total number of observations

W is exactly the F statistic of a one-way ANOVA applied to the Zᵢⱼ. The test is always right-tailed: only a large W is evidence against equal variances.

Results match scipy.stats.levene for all three centres. For the trimmed mean, floor(proportion × nᵢ) values are removed from each end of the sorted group to find the centre, and all nᵢ observations still contribute a deviation, as in current SciPy. Some other programs also drop the trimmed values from the deviations, which gives a slightly different W.

Worked example

Worked example: waiting times at three clinics

Problem. Waiting times in minutes for ten patients at each clinic. A: 23, 25, 22, 26, 24, 27, 21, 25, 24, 23. B: 18, 29, 24, 33, 20, 27, 15, 31, 22, 26. C: 21, 27, 24, 29, 20, 26, 23, 28, 22, 25. Are the waiting times equally variable at α = 0.05? Use the median as the centre.

  1. 01Medians: A = 24, B = 25, C = 24.5.
  2. 02Absolute deviations from each median average Z̄₁ = 1.4 (A), Z̄₂ = 4.7 (B) and Z̄₃ = 2.5 (C); the overall mean deviation is Z̄ = 86 / 30 = 2.8667.
  3. 03SS between = 10(1.4 − 2.8667)² + 10(4.7 − 2.8667)² + 10(2.5 − 2.8667)² = 56.4667, so MS between = 56.4667 / 2 = 28.2333.
  4. 04SS within = 114.5, so MS within = 114.5 / 27 = 4.2407.
  5. 05W = 28.2333 / 4.2407 = 6.6576 with df = (2, 27); critical F = 3.3541.
  6. 06p = P(F₂,₂₇ ≥ 6.6576) ≈ 0.0045.

Answer. W = 6.66 exceeds the critical value 3.35 (p ≈ 0.0045), so reject H₀: the clinics do not have equal variances. Clinic B is far less consistent (s² = 33.61 against 3.33 for clinic A). Centring on the mean instead gives W = 6.81, p ≈ 0.0040, the same conclusion.

Mean, median or trimmed mean: which centre to use

All three versions use the same W formula; they differ only in the centre each value is measured from. That choice controls how the test behaves when the data are not normal.

CentreUsual nameBest forSoftware that uses it by default
MedianBrown–Forsythe testSkewed data; the safest general choiceSciPy, R (car::leveneTest), Minitab
MeanLevene’s test (1960)Symmetric, moderate-tailed dataSPSS
Trimmed meanTrimmed Levene testHeavy-tailed data with outliersOptional in SciPy (center='trimmed') and Stata (robvar)

What to do after Levene’s test

A significant result (p ≤ α) means the equal-variance assumption is not safe. For two groups, switch from the pooled t-test to Welch’s t-test; for three or more, use Welch’s ANOVA or a robust alternative instead of the classic F-test, and prefer Games–Howell over Tukey’s HSD for follow-up comparisons.

A non-significant result does not prove the variances are equal. With small groups the test often misses real differences, and with very large groups it flags differences too small to matter. Look at the variance ratio as well: ANOVA and the pooled t-test cope well when the largest variance is under about four times the smallest and the group sizes are similar.

Sources and how the results were checked

The method follows Levene (1960) and Brown and Forsythe (1974). The worked example and the example presets were checked against SciPy 1.18 (scipy.stats.levene with center='median', 'mean' and 'trimmed') and agree to the decimals shown: W = 6.6576, p = 0.0045 (median) and W = 6.8063, p = 0.0040 (mean).

  • Levene, H. (1960). Robust tests for equality of variances. In I. Olkin (Ed.), Contributions to Probability and Statistics: Essays in Honor of Harold Hotelling (pp. 278–292). Stanford University Press.
  • Brown, M. B., & Forsythe, A. B. (1974). Robust tests for the equality of variances. Journal of the American Statistical Association, 69(346), 364–367. doi:10.1080/01621459.1974.10482955
  • NIST/SEMATECH e-Handbook of Statistical Methods, 1.3.5.10 Levene Test for Equality of Variances.
  • SciPy documentation, scipy.stats.levene.

Common use cases

  • Checking the equal-variance assumption before a pooled t-test or one-way ANOVA.
  • Comparing the consistency of several machines, production lines, laboratories or suppliers.
  • Testing whether a treatment changes the variability of a response, not just its average.
  • Deciding between Tukey’s HSD and Games–Howell for post-hoc comparisons.
  • Reproducing the Levene F that SPSS, R or Python reports for a homework or thesis table.

Assumptions and limitations

  • Independent observations: the groups must contain different, unrelated units. Repeated measurements on the same subjects need a different approach.
  • Raw data required: the test is built from individual deviations, so it cannot be computed from means and standard deviations alone. With only summary statistics for two groups, the F-Test Calculator is the fallback, but it assumes normal data.
  • Low power in small samples: with fewer than about 10 values per group, real differences in spread are often missed. Many statisticians skip the preliminary test and use Welch’s t-test by default.
  • The test compares spread around each group’s own centre. It does not test whether the centres differ; use the ANOVA Calculator or a t-test for that.
  • To test one variance against a claimed value rather than against other groups, use the One-Sample Variance Test Calculator.
  • Check normality separately with the Shapiro–Wilk Test Calculator; Levene’s test does not tell you whether the data are normal.

Frequently asked questions

What is Levene’s test?

Levene’s test is a test of equality of variances: it checks whether two or more independent groups have the same population variance. It was proposed by Howard Levene in 1960 and is the most common check of the homogeneity of variance assumption before a t-test or ANOVA, because, unlike the F-test and Bartlett’s test, it does not need normally distributed data.

How is Levene’s test calculated?

Find each group’s centre (median or mean), replace every value by its absolute distance from that centre, then run a one-way ANOVA on the distances. The ANOVA F is Levene’s W; compare it with an F distribution with k − 1 and N − k degrees of freedom to get the p-value. In the clinic example the mean distances are 1.4, 4.7 and 2.5, giving W = 6.66 and p = 0.0045.

What is the difference between Levene’s test and the Brown–Forsythe test?

They are the same procedure with a different centre. Levene’s original test measures each value’s distance from its group mean; the Brown–Forsythe test uses the group median. The median version keeps its false-positive rate close to α for skewed distributions, which is why SciPy and R use it by default, while SPSS reports the mean version.

How do I interpret the p-value of Levene’s test?

The null hypothesis is that all groups have the same variance. If p ≤ α (usually 0.05), reject it: the spreads differ, and tests that assume equal variances should be replaced by Welch versions. If p > α, there is no evidence of unequal variances, which supports, but does not prove, the assumption.

Why does my Levene’s test result differ from SPSS?

SPSS’s headline “Levene’s Test for Equality of Variances” is centred on the mean, while Python’s SciPy and R’s leveneTest centre on the median unless told otherwise. Set the centre to Mean in this calculator to reproduce the SPSS value; the two versions usually agree on the decision but not on the exact F.

Is Levene’s test better than the F-test for equal variances?

For real data, usually yes. The F-test and Bartlett’s test assume normal populations and reject far too often when the data are skewed or heavy-tailed. Levene’s test works on absolute deviations, so it is much less affected by non-normality, and it extends to any number of groups.

What are the degrees of freedom for Levene’s test?

The numerator degrees of freedom are k − 1, where k is the number of groups, and the denominator degrees of freedom are N − k, where N is the total number of observations. For three groups of ten, that is F(2, 27). They are the same as in a one-way ANOVA on the same data.

What should I do if Levene’s test is significant?

Use a method that does not assume equal variances. For two groups that is Welch’s t-test; for three or more it is Welch’s ANOVA with Games–Howell post-hoc comparisons. Transforming the outcome (for example taking logs) can also stabilise the variances when spread grows with the mean.

Cite this page

Statculator. (2026, November 14). Levene’s Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/levenes-test-calculator/