Math calculator

Friedman Test Calculator

Repeated measures by rank, with the magnitudes it discards shown.

Ranks within each block, and nothing else

Six subjects, three conditions. Statistic 9.000 on 2 df, p = 0.0111, Kendall’s W = 0.75 — strong agreement about the ordering.

6 blocks, 3 treatments, 2 degrees of freedom

χ²F = 9.000000, p = 0.011109

Treatment 1 has the lowest mean rank at 1.0000 and treatment 2 the highest at 2.5000. Kendall's W is 0.7500 — strong agreement between blocks about the ordering.

Friedman χ²

9.000000

df = 2

p-value

0.011109

chi-square approximation

Kendall's W

0.75000

0 = no agreement, 1 = perfect

Blocks

6

3 treatments each

Mean rank and rank sum for each treatment
TreatmentRank sumMean rankStanding
Treatment 16.000001.0000lowest — ranked best most often
Treatment 215.000002.5000highest — ranked worst most often
Treatment 315.000002.5000in between

What the test actually read

Each block with its raw values and the within-block ranks the test used
BlockRaw values (discarded)Within-block ranks (used)
17.00000, 9.00000, 8.000001.000, 3.000, 2.000
26.00000, 8.00000, 7.000001.000, 3.000, 2.000
39.00000, 10.00000, 11.000001.000, 2.000, 3.000
45.00000, 7.00000, 6.000001.000, 3.000, 2.000
58.00000, 9.00000, 10.000001.000, 2.000, 3.000
66.00000, 7.00000, 9.000001.000, 2.000, 3.000

Replace every number in the left column with any other set in the same order and the right column does not move — nor does the p-value. That invariance is the test’s strength and its cost in one table.

Ranking within blocks is what removes the block effect. A subject who scores high on everything and one who scores low both contribute the same ranks, so differences BETWEEN subjects cancel out entirely. That is why this is the non-parametric counterpart of a repeated-measures design rather than of a one-way comparison.
Kendall’s W is the effect size, and it is just the statistic rescaled. W = χ²F ÷ (blocks × (treatments − 1)), so it runs from 0 to 1 and answers the question the p-value does not: how much the blocks agree about the ordering. A significant result with a W of 0.2 means many blocks weakly agreeing, not a strong effect.
The p-value uses a chi-square approximation, which is poor with few blocks. With three treatments and fewer than about nine blocks it is noticeably off, and an exact permutation distribution is the correct reference. Treat a borderline result on a small design as undecided rather than as evidence.

What this tool shows

Three blocks of [1, 2, 3] plus one of [1000, 2000, 3000] give Kendall’s W of exactly 1 and the identical statistic. A block where the treatments differ by a thousand contributes precisely what one differing by 1 does, because only the within-block ORDER is read. The tool prints the raw values beside the ranks so the trade is visible.

  • Friedman's chi-square with degrees of freedom and p-value
  • Kendall's W as the effect size — 0 is no agreement, 1 is perfect
  • Mean rank and rank sum for every treatment, with best and worst named
  • The within-block rank matrix beside the raw values it came from
  • Midranks for ties, handled correctly within each block
  • A flag when one block spans a far wider range than the others
Repeated measures Kendall's W Rank matrix shown Ties handled

Only the order within each block is used.

Updated 12 September 2026 · Works in any browser, no installation

Friedman’s test ranks the treatments within each block and asks whether the rank sums differ more than chance allows. Ranking within blocks is what removes the block effect entirely: a subject who scores high on everything and one who scores low contribute identical ranks. It is the non-parametric counterpart of a repeated-measures ANOVA.

At a glance

Formula shown
Rank the k treatments within each of the b blocks, then χ²F = [12/(bk(k+1))]·ΣRⱼ² − 3b(k+1), compared against a chi-square on k − 1 degrees of freedom. Rⱼ is treatment j’s rank sum across blocks. Kendall’s W = χ²F / (b(k−1)) rescales the same quantity to run from 0 to 1, and is the effect size. Ties within a block take midranks.
Scenario support
The same subjects measured under several conditions, several judges rating the same items, before-during-after designs, matched blocks in an agricultural or clinical trial, and any repeated-measures comparison where the outcome is ordinal or the differences are not normal.
Educational estimate
Planning support from the values you enter — not professional advice.

The magnitudes are discarded, completely

Every rank-based test gives up magnitude information. Friedman gives it up block by block, which makes the loss larger than people expect.

Three blocks of [1, 2, 3] and one of [1000, 2000, 3000] are treated identically. All four rank as 1, 2, 3. Kendall’s W is exactly 1, and the statistic is the same as for four identical small blocks.

So a block where the treatment effect is enormous carries the same weight as one where it is negligible. If the size of the effect varies between subjects — which it usually does — that variation is invisible here.

Any monotone transform within a block changes nothing. Log the values, square them, convert to percentages: the ranks and the p-value are unchanged, verified in the suite. That invariance is the test’s strength and its cost in one sentence.

The tool prints both columns — raw values and the ranks they became — so the discarding is visible rather than implied.

Where the magnitudes matter, a repeated-measures ANOVA uses them, at the cost of assuming the differences are roughly normal and that the covariance structure is well behaved. That is a real trade rather than a strictly better option.

Ranking within blocks is what removes the block effect

The design this test is for has a nuisance factor built in: the subjects differ from one another, and that difference is not what you are studying.

A subject who scores high on every condition contributes the ranks 1, 2, 3 — exactly as a subject who scores low on every condition does. The between-subject variation cancels entirely, without being modelled.

Which is why it is a repeated-measures test rather than a one-way one. Comparing the same treatments across INDEPENDENT groups is a different question, answered by Kruskal-Wallis, which ranks across the whole dataset instead of within blocks.

The blocks must be complete. Every treatment has to appear in every block, because the ranking is within-block. A missing value cannot be ignored; the block has to be dropped or the design changed.

And the blocks must be independent of each other, even though the observations within a block are not. That is the assumption doing the work, and it is the one worth checking against how the data was collected.

Kendall's W is the effect size, and it is the statistic rescaled

The p-value says the treatments differ. W says how much the blocks agree about the ordering, which is usually the more interesting number.

W = χ²F ÷ (blocks × (treatments − 1)), so it is the same quantity on a 0-to-1 scale. Nothing new is computed.

W = 1 means every block produced the same ordering. Perfect agreement, whatever the magnitudes were. W = 0 means the orderings are as inconsistent as chance would produce.

A significant result with a low W means many blocks weakly agreeing. That is a different finding from a few blocks agreeing strongly, and the p-value cannot distinguish them — adding blocks raises significance without raising W.

It is also the standard measure of inter-rater agreement for ranked data, which is why the same number appears in reliability work under Kendall’s name rather than Friedman’s. The two are the same calculation applied to the same table for different purposes.

A significant result does not say which treatments differ

The test is omnibus. It rejects “all treatments are equivalent” without naming a pair.

The mean ranks are the first place to look. The tool names the lowest and highest, which is often the whole finding — but a gap in mean ranks is not itself a test.

Post-hoc comparisons need a correction. Comparing all pairs of three treatments is three tests; of five, ten. Without a correction the chance of at least one false positive is far above the nominal level.

The usual route is a Nemenyi or a Conover test, both built on the same rank sums and both applying a correction for the number of comparisons. Running a Wilcoxon signed-rank test on each pair and correcting is the simpler alternative.

And doing any of this only after a significant omnibus result is itself a choice that affects the error rate — the same issue that arises after a significant ANOVA, and one that is usually left unstated.

The chi-square approximation is poor on small designs

The reference distribution is asymptotic, and “asymptotic” here means more blocks than most designs have.

With three treatments and fewer than about nine blocks it is noticeably off. The statistic takes only a limited set of values, so a continuous chi-square is a rough fit and the p-value can be materially wrong in either direction.

The exact distribution is computable by enumeration for small designs — every possible assignment of ranks within every block — and published tables exist for the common cases.

So a borderline p-value on a small design is undecided rather than evidence. The honest reading of p = 0.06 with four blocks is that the design could not settle the question.

More treatments help more than more blocks do, for the approximation: the chi-square fit improves with k as well as with b, and a design with five treatments and six blocks is better behaved than one with three treatments and six.

Reporting a Friedman test

Four things, and the second is the one most often left out.

Report the statistic with df, the number of blocks and the number of treatments. “χ²F(2) = 9.00, p = 0.011, 6 blocks” is checkable; a bare p-value is not.

Report Kendall’s W. It is free — the statistic rescaled — and it is the only number that says how strong the agreement is rather than how confident you are that it exists.

Give the mean ranks. They are the direction of the finding, and the omnibus statistic carries none of it.

And say what post-hoc procedure you used, if any. Pairwise comparisons after a significant omnibus test need a correction, and the one you chose changes which pairs come out significant.

Sources and methodology

References for Friedman's test and Kendall's W.

Method. Ranking is done within each block with midranks for ties, and the rank matrix is printed beside the raw values so what the test read is visible rather than implied. The central claim is verified rather than described: three blocks of [1, 2, 3] plus one of [1000, 2000, 3000] give exactly the same statistic and a Kendall’s W of exactly 1 as four identical small blocks, and applying a log or a square to every value leaves the statistic unchanged to machine precision. Kendall’s W is computed as the statistic rescaled rather than independently, so the two can never disagree. Ragged rows, a single block and a single treatment all return no result rather than a number. That engine is verified on every change against 69 assertions. The count and the per-case breakdown are published on the formula verification page.

Related calculators

Where this goes next:

Kruskal-WallisApplies the tie correction and shows it against the uncorrected value, because on ordinal data it moves p from 0.054 to 0.027 — across the conventional threshold, on identical data.
Wilcoxon Signed-RankReports how many zero differences it dropped and gives the Hodges-Lehmann shift, because the classical and Pratt variants disagree on the same data and the median of the differences is not what this test estimates.
One-Way ANOVAThe full F table with eta and omega squared, plus every pairwise gap — because a significant F says something differs and never says which, and ten groups tested pairwise carry a 90% false-positive rate.
Sign TestThe exact binomial sign test with the paired t-test on the same numbers beside it, and every difference listed next to the sign it was reduced to — so the cost of discarding the magnitudes is visible.
Cohen's KappaKappa with the two figures that explain it: the maximum the marginals permit, and PABAK. Two built-in tables with identical 85% agreement give kappas of 0.6995 and 0.3219, and a third with 94.4% agreement gives −0.0234.
Kendall TauComputes τ-a, τ-b and τ-c with the concordant and discordant pair counts, because the three definitions disagree — 0.7143, 0.8729 and 0.9375 on the built-in tied preset, from the same eight pairs.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. The test uses only the ordering within each block, so a design where the size of the effect varies between blocks will look identical to one where it does not — and on fewer than about nine blocks the chi-square approximation is rough enough that a borderline p-value should be read as undecided.

How we calculate · Found an error? email us

Authorship & verification

Written and maintained by , a business operator who builds spreadsheet-based calculators.

What's changed (5 updates)

Published 12 September 2026

  1. Published a repeated-measures rank test that prints the within-block rank matrix beside the raw values, so what the test read and what it discarded are both on the page.
  2. Demonstrated the cost of ranking within blocks with a case that cannot be argued with: three blocks of [1, 2, 3] plus one of [1000, 2000, 3000] give Kendall's W of exactly 1 and the same statistic as four identical small blocks. A block where the treatment effect is enormous carries exactly the weight of one where it is negligible.
  3. Verified the invariance that follows: applying a log or a square to every value within a block leaves the statistic unchanged to machine precision.
  4. Computed Kendall's W as the statistic rescaled rather than independently, so the effect size and the test can never disagree about the same table.
  5. Verified against 69 assertions covering midranks for ties, the omnibus statistic, W, and the ragged designs that must return no result rather than a number.

Add this calculator to your site

Responsive embed — and private: nothing your visitors type leaves their browser.