Friedman Test Calculator

Friedman Test Calculator

Compare three or more related groups by ranking each block's scores — the non-parametric alternative to repeated measures ANOVA. Paste your data as a table (one row per block, one column per treatment) and get the tie-corrected Friedman chi-square, an exact p-value for small samples, Kendall's W and Nemenyi and Conover post-hoc tests.

Each row is one block (for example one judge); each column is one treatment. Ranks are worked out within each row.
Leave blank for Treatment 1, Treatment 2 and so on.
FRIEDMAN Q · DF 3
—

P-value (asymptotic)
—
Exact p-value
—
Kendall's W
—
Iman–Davenport F
—
Nemenyi critical difference
—
Conover pairs significant
—

How it was worked out

    Mean ranks — higher is better here

    Within-block ranks

    Each row is ranked separately (1 = smallest score; tied scores share the average rank).

    Post-hoc pairwise comparisons

    The Friedman test is the non-parametric alternative to repeated measures ANOVA: it compares three or more related groups by ranking each person’s scores. It needs no normality assumption and works with ordinal data. This calculator gives the tie-corrected chi-square statistic, an exact p-value for small samples, Kendall’s W and post-hoc pairwise tests.

    How to use the Friedman test calculator

    Paste your data as a table: one row per block (one person, one judge, one matched set) and one column per treatment. The calculator ranks the scores inside each row, then works out the Friedman statistic, Kendall’s W and the post-hoc tests.

    1. Paste the data, one block per line, with the values separated by commas or spaces. Each row must have the same number of values.
    2. Type the treatment names if you want them on the tables and chart, or leave the field blank for Treatment 1, Treatment 2 and so on.
    3. Choose the significance level (α) and which post-hoc method to show: Nemenyi, Conover, or both.
    4. Press Calculate, or load one of the two worked examples below and watch every number appear, with the full working shown in the ledger.

    Try it now: the wine-tasting example is already loaded. Ten judges scored four wines, and the calculator gives Q = 27.72 with df = 3 and p < 0.0001, Kendall’s W = 0.924 and an Iman–Davenport F(3, 27) = 109.42. Press Load Example 2 for the small-sample case, where the exact p-value (0.5705) is the one to report.

    When should you use the Friedman test?

    Use the Friedman test when the same blocks are measured under three or more conditions and you cannot assume normality — for example, the same judges rating several wines, the same patients measured at four visits, or the same plots given three fertilisers. It is the right test when:

    • The groups are related: the same people, or matched sets, appear in every condition. For independent groups, use the Kruskal-Wallis test instead.
    • The data are ordinal or skewed: ranks, Likert scores or measurements that are clearly not normal. If the data are normal, a repeated measures ANOVA has more power.
    • There are three or more conditions. With only two related conditions, use the Wilcoxon signed-rank test.
    • Blocks are independent of each other: one judge’s scores do not affect another’s.
    • Ties are allowed: equal scores inside a block share the average rank, and the calculator applies the tie correction automatically.

    The Friedman test is a test of the ranks, not the raw scores, so a few extreme values cannot dominate the result. That is its strength — and its cost: it throws away the size of the differences and keeps only their order.

    Rule of thumb: same people, three or more conditions, ordinal or non-normal data — Friedman. Same people, normal data — repeated measures ANOVA. Different people in each group — Kruskal-Wallis. Only two conditions — Wilcoxon signed-rank.

    How the Friedman test works

    The test ignores the raw scores and works with ranks. Inside each block, the smallest score gets rank 1 and the largest gets rank k (the number of treatments); tied scores share the average of the ranks they cover. Then the ranks are added up for each treatment. If the treatments were all the same, the rank sums would be roughly equal; if one treatment is consistently ranked higher, its rank sum pulls away.

    The Friedman statistic is:

    Q = [12 / (b · k · (k + 1))] · ΣR² − 3 · b · (k + 1)

    where b is the number of blocks, k the number of treatments and R the rank sum of each treatment. When scores are tied inside a block, Q is divided by the tie-correction factor C = 1 − T / (b · k · (k² − 1)), where T adds up (t³ − t) over every group of t tied scores. Under the null hypothesis of no treatment difference, Q follows a chi-square distribution with k − 1 degrees of freedom, which gives the asymptotic p-value. The calculator also reports the chi-square result alongside the exact p-value, so you can see both.

    Kendall’s W — how much do the blocks agree?

    Kendall’s W measures the agreement between blocks on the ranking. It is Q divided by its maximum possible value, W = Q / (b · (k − 1)), so it runs from 0 (no agreement) to 1 (perfect agreement). Use these bands: below 0.10 very weak, 0.10 to 0.29 weak, 0.30 to 0.49 moderate, 0.50 to 0.69 strong, and 0.70 or more very strong. A significant Friedman test with a small W means the treatments differ but the blocks disagree about the order; a large W means the ranking is consistent from block to block.

    Iman–Davenport F — a better approximation

    The chi-square approximation can be conservative, so Iman and Davenport suggested an F version: F = [(b − 1) · Q] / [b · (k − 1) − Q], with df1 = k − 1 and df2 = (b − 1)(k − 1). It is usually a little more accurate than the chi-square p-value, and the calculator reports both so you can compare them.

    Exact p-value for small samples

    With few blocks, the chi-square approximation is rough. The exact p-value counts every possible way of assigning the ranks inside each block and takes the share that gives a Friedman Q at least as large as the one observed. The calculator enumerates all within-block rank permutations for samples up to 8 blocks and 4 treatments (up to 5,000,000 permutations). For larger samples it says so and the asymptotic p-value is the one to report.

    Post-hoc tests: Nemenyi and Conover

    A significant Friedman test only says the treatments differ somewhere. To find which pairs differ, use a post-hoc test. Nemenyi compares every pair of mean ranks with a single critical difference, CD = q · √[k(k + 1) / (6b)], where q is the studentised range value. It is simple but conservative. Conover–Iman runs t-tests on the within-block ranks (a two-way ANOVA on the ranks gives the error term), which is more powerful; because it does not correct for multiple testing, the calculator applies a Bonferroni correction to the p-values. When the two methods disagree, report both and say which you used.

    Worked example 1 — ten judges rate four wines

    Ten judges each taste four wines and score them from 1 to 10. The question is whether the wines are rated differently. The data are ordinal scores from the same judges, so the Friedman test is the right choice.

    JudgeWine AWine BWine CWine D
    17586
    26495
    38697
    45374
    57586
    66587
    78496
    87685
    96475
    108597

    Ranking inside each judge’s row gives the rank sums: Wine A 29, Wine B 11, Wine C 40, Wine D 20, so the mean ranks are 2.9, 1.1, 4.0 and 2.0. There are no ties, so the tie correction is C = 1.0000. The Friedman statistic is Q = [12 / (10 · 4 · 5)] · (29² + 11² + 40² + 20²) − 3 · 10 · 5 = 27.72 with df = 3, and the asymptotic p-value is p < 0.0001. Kendall’s W = 27.72 / 30 = 0.924, very strong agreement: the judges agree closely on the ranking. The Iman–Davenport F(3, 27) = 109.42, p < 0.0001, agrees.

    For the post-hoc tests, the Nemenyi critical difference is CD = 3.6332 · √[4 · 5 / 60] = 2.0976. Only one pair differs by more than the CD — Wine B vs Wine C (2.9) — so Nemenyi, which is conservative, finds only that pair significant. The Conover–Iman tests are more powerful: with MSE = 0.1407, SE = 0.1678 and df = 27, every pair is significant after Bonferroni correction (all ps < 0.001), so by Conover, Wine C was rated higher than every other wine, and Wine B lower than every other wine. The two methods answer slightly different questions — Nemenyi asks which pairs clear a single conservative bar, Conover tests each pair directly — so report the method you used.

    Worked example 2 — six blocks, three treatments (small n)

    Three treatments are compared in six matched blocks. With only six blocks the chi-square approximation is rough, so the exact p-value matters.

    BlockTreatment ATreatment BTreatment C
    1321
    2231
    3312
    4213
    5321
    6132

    The rank sums are 14, 12 and 10, so the mean ranks are 2.3333, 2.0 and 1.6667. The Friedman statistic is Q = 1.3333 with df = 2. The asymptotic p-value is 0.5134, but the exact p-value, by enumerating all 66 = 46,656 within-block rank permutations, is 0.5705 — and the exact p is the one to report at this sample size. Kendall’s W = 0.1111, weak agreement, and the Nemenyi critical difference is 1.9136, which no pair exceeds. The conclusion is that there is no evidence of a treatment difference, and with only six blocks the test has little power: a non-significant result here does not show the treatments are equal.

    How to interpret the results

    • Start with the p-value. If p < α, the treatments differ somewhere; if p ≥ α, you do not have evidence of a difference. A non-significant result is not proof of no difference, especially with few blocks.
    • Read Kendall’s W next. It says how much the blocks agree on the ranking. W = 0.924 (Example 1) means the judges rank the wines almost identically; W = 0.111 (Example 2) means the blocks barely agree, so the ranking is noisy.
    • Use the post-hoc tests to say which pairs differ. Nemenyi is the conservative choice; Conover with a Bonferroni correction has more power. Name the method in your report, because the two can disagree, as they do in Example 1.
    • Check the exact p-value when the sample is small. With up to 8 blocks and 4 treatments the calculator gives the exact p; below that size, prefer it over the chi-square approximation. Above it, the approximation is fine.
    • Report the mean ranks, not just the p-value. The mean ranks (for example 2.9, 1.1, 4.0, 2.0 in Example 1) show the direction and size of the differences.

    Assumptions of the Friedman test

    • Related groups: the same blocks appear under every treatment (repeated measures, matched sets or the same judges).
    • Independent blocks: the blocks do not influence each other.
    • Ordinal or continuous data: the scores can be ranked inside each block. The test needs no normality assumption, which is the point of using it instead of a repeated measures ANOVA.
    • No assumption of equal variances or sphericity: because the test works on ranks, the variance and sphericity assumptions of ANOVA do not apply.
    • Ties are handled: equal scores inside a block share the average rank and the tie correction is applied. With many ties, the correction matters more, and the exact p-value becomes more important.

    If the blocks are not matched, the Friedman test is the wrong test — use the Kruskal-Wallis test for independent groups, or a one-way ANOVA if the data are normal. If the data are normal and you need the extra power, check normality with the Shapiro-Wilk test first, then use repeated measures ANOVA.

    How to report the Friedman test in APA style

    Report the chi-square statistic with its degrees of freedom, the p-value and Kendall’s W, then the post-hoc method and what it found. Use “p < .001” when the p-value rounds to 0.000 at three decimals, and give W to two decimals.

    Copy this sentence and fill in your numbers: A Friedman test showed a significant difference in wine ratings, χ²(3) = 27.72, p < .001, Kendall’s W = .92. Conover post-hoc tests with Bonferroni correction showed that Wine C was rated significantly higher than all other wines (all ps < .001).

    For the small-sample example, the honest sentence is: “A Friedman test found no significant difference between treatments, χ²(2) = 1.33, p = .571 (exact p), Kendall’s W = .11.” Note the exact p-value (0.5705, reported as .571) rather than the asymptotic 0.5134.

    Cite this tool: Shafiq, A. (2026). Friedman Test Calculator. Empirical Rule Calculators. https://empiricalrulecalculators.com/friedman-test-calculator/

    Frequently asked questions

    Friedman test vs repeated measures ANOVA — which do I use?

    Use repeated measures ANOVA when the data are approximately normal and measured on an interval or ratio scale — it has more power. Use the Friedman test when the data are ordinal (ranks, Likert scores), skewed, or clearly not normal. If you are unsure, check normality with the Shapiro-Wilk test first; if the data fail it, Friedman is the safe choice.

    What is Kendall’s W?

    Kendall’s W is the effect size for the Friedman test: it measures how much the blocks agree on the ranking, from 0 (no agreement) to 1 (perfect agreement). It is Q divided by its maximum possible value, W = Q / (b · (k − 1)). Below 0.10 is very weak, 0.10 to 0.29 weak, 0.30 to 0.49 moderate, 0.50 to 0.69 strong, and 0.70 or more very strong. Always report it alongside the p-value, because it says whether the ranking is consistent, not just whether it differs.

    When should I use the exact p-value?

    Use the exact p-value when the sample is small — roughly, fewer than 10 to 15 blocks, or when the chi-square approximation is doubtful. It counts every possible assignment of the ranks inside each block and is exact rather than approximate. This calculator computes it by full enumeration for up to 8 blocks and 4 treatments (up to 5,000,000 permutations). For larger samples the chi-square and Iman–Davenport p-values are accurate enough.

    Nemenyi or Conover — which post-hoc test?

    Nemenyi is simple and conservative: it compares every pair of mean ranks against one critical difference. Conover–Iman runs t-tests on the ranks and is more powerful, but it does not correct for multiple testing on its own, so this calculator applies a Bonferroni correction to its p-values. When they disagree, as in the wine example, report both and name the method you used. If you need a single conservative answer, use Nemenyi; if you need power, use Conover with Bonferroni.

    Can the Friedman test handle ties?

    Yes. Tied scores inside a block share the average of the ranks they cover, and the Friedman statistic is divided by the tie-correction factor C = 1 − T / (b · k · (k² − 1)). The calculator applies the correction automatically and shows the value of T and C in the ledger. With many ties, the exact p-value is more reliable than the chi-square approximation, because the approximation assumes continuous data.

    Sources: Friedman, M. (1937). The use of ranks to avoid the assumption of normality implicit in the analysis of variance. Journal of the American Statistical Association, 32(200), 675–701. Kendall, M. G. (1948). Rank Correlation Methods. Iman, R. L., & Davenport, J. M. (1980). Approximations of the critical region of the Friedman statistic. Communications in Statistics — Theory and Methods, 9(6), 571–595. Nemenyi, P. B. (1963). Distribution-free multiple comparisons. Conover, W. J., & Iman, R. L. (1981). Rank transformations as a bridge between parametric and nonparametric statistics. The American Statistician, 35(3), 124–129. The worked examples on this page were checked against SciPy’s friedmanchisquare (Q = 27.72 for Example 1) and full permutation enumeration (exact p = 0.5705 for Example 2).

    See all 106 free statistics tools on Empirical Rule Calculators.

    Next steps

    Keep going with the non-parametric family — the tools that pair with the Friedman test.

    📊● LiveANOVA

    Repeated Measures ANOVA Calculator

    The parametric version of this test — use it when the data are roughly normal.Try Calculator →

    📊● LiveNonparametric

    Kruskal-Wallis Test Calculator

    Compare three or more independent groups by rank — the unpaired version of this test.Try Calculator →

    🔀● LiveNonparametric

    Wilcoxon Signed-Rank Test Calculator

    Two related conditions instead of three or more — the paired rank test.Try Calculator →

    More Tools to Explore

    Keep going with the calculators that pair with the Friedman test — non-parametric tests, ANOVA and normality checks.