Math calculator

Phi Coefficient Calculator

Association in a 2×2 table, shown against the largest value its margins allow.

A 2×2 table and its marginal ceiling

Every single case is exposed — the strongest association this table can hold — and φ is only 0.3333333. That is identical to maxφ: the coefficient is already at its ceiling.

n = 100, χ² = 11.1111

φ = 0.3333333

These marginals cap |φ| at 0.3333333, so this table reaches 100.0% of the strongest association it could possibly show. It is already at the ceiling — no rearrangement of these row and column totals produces a larger φ. Pearson's r on the same two 0/1 variables is 0.3333333, the same number by construction.

φ

0.3333333

= Pearson’s r on 0/1

Ceiling (max φ)

0.3333333

reached

χ²

11.1111

df = 1

Cramér's V

0.3333333

identical to |φ| on a 2×2

The 2×2 table with its row, column and grand totals
OutcomeNo outcomeRow total
Exposed104050
Not exposed05050
Column total1090100

|φ| can reach 1 only when the row split matches the column split. Here the rows divide 50.0/50.0 and the columns 10.0/90.0, which is what sets the ceiling of 0.33333.

φ² × n = χ², exactly On a 2×2, φ and Cramér’s V are the same number An empty row or column leaves φ undefined

What this tool shows

In the table [10, 40, 0, 50] every single case is exposed — as complete an association as those totals can hold — and φ is 0.3333333. That is identical to maxφ for this table: the coefficient is already at its ceiling. Reading 0.33 as a weak association reads the marginals rather than the data, so the tool prints the ceiling beside every result.

  • The phi coefficient for any 2×2 table of counts
  • max |φ| — the largest value these row and column totals permit
  • The share of that ceiling the table actually reaches
  • Chi-square on 1 degree of freedom, with the exact φ² × n identity
  • Pearson’s r on the same two 0/1 variables, computed independently
  • Cramér’s V, which equals |φ| on a 2×2 and diverges above it
2×2 association φ² × n = χ² Marginal ceiling Pearson identity

|φ| reaches 1 only when the row split matches the column split.

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

The phi coefficient is Pearson’s r applied to two binary variables coded 0 and 1. Same coefficient, different name, and on a 2×2 table it is also Cramér’s V. It relates to chi-square exactly: φ² × n = χ², which makes φ the effect size for a test that has none of its own.

At a glance

Formula shown
φ = (ad − bc)/√((a+b)(c+d)(a+c)(b+d)) for the table [[a, b], [c, d]]. Because the denominator contains all four marginal totals, |φ| can reach 1 only when the row proportions match the column proportions; otherwise the ceiling is below 1 and is computed by rearranging the counts to the most extreme table those same totals allow. Equivalently φ = √(χ²/n), which is why the two are one statement about the table.
Scenario support
Exposure against outcome in a 2×2 cohort or case-control table, treatment versus control with a binary endpoint, agreement between two yes/no raters, whether two survey items are answered together, A/B tests with a binary conversion, and any pair of dichotomous variables where the question is how strongly they move together.
Educational estimate
Planning support from the values you enter — not professional advice.

The margins decide how large φ is allowed to be

Every correlation coefficient is read against a scale from −1 to 1. For phi that scale is usually unreachable, and how unreachable depends entirely on the row and column totals.

Take [10, 40, 0, 50]. Fifty exposed, fifty not; ten with the outcome, ninety without. Every single case with the outcome is in the exposed group — there is no stronger pattern these totals can express. φ = 0.3333333.

And maxφ for that table is also 0.3333333. The coefficient is at its ceiling. Rearranging the counts any other way, keeping the same margins, gives a smaller value.

Compare [10, 0, 0, 90], where the splits match. Ten exposed and ten with the outcome, and they are the same ten. φ = 1 exactly, because here the ceiling is 1.

So the difference between 0.33 and 1.00 is not strength of association. Both tables show a complete association. The first is describing a rare outcome in a common exposure, and phi cannot separate that from a genuinely weak relationship without the ceiling printed beside it.

φ and chi-square are one statement, split in two

The relationship is exact and worth knowing, because it explains why a huge chi-square can sit beside a modest phi without either being wrong.

φ² × n = χ², on the nose. The tool’s first preset has φ = 0.4082483 and n = 100, and χ² = 16.6667 — 0.4082483² × 100.

Chi-square scales with the sample size; phi does not. Double the counts in every cell and χ² doubles while φ is unchanged, because the pattern is identical and only the evidence for it has grown.

Which is why phi is the effect size a chi-square test lacks. The test answers “is there an association?” and phi answers “how large?” — and on large samples the first says yes to associations the second calls negligible.

The fourth preset shows the split clearly: χ² = 55.0812 on 1 degree of freedom is overwhelming evidence, and φ = 0.2346939 describes the association it is evidence for as modest. Both readings are correct.

φ, the odds ratio and relative risk disagree on purpose

The same 2×2 table supports several summaries, and they are not competing estimates of one quantity — they answer different questions and behave differently under the same data.

The odds ratio is unbounded above and is invariant to the margins in a way phi is not. A complete association gives an infinite odds ratio whatever the row and column splits are, which is exactly the property phi lacks.

It is also the only one of the three that survives case-control sampling, where the researcher fixes how many cases and controls to recruit. Fixing a margin changes phi and relative risk and leaves the odds ratio alone.

Relative risk is the one clinicians read, because it is a ratio of probabilities rather than of odds, and it needs a cohort design to be meaningful.

Phi’s advantage is that it is a correlation. It sits on the same scale as every other Pearson correlation in an analysis, which matters when binary and continuous variables appear in one correlation matrix.

Reporting phi alone for a rare outcome understates the relationship, every time, because the ceiling is low. That is a reason to report the odds ratio beside it rather than a reason to distrust either.

Where φ ends and Cramér’s V begins

On a 2×2 table the two coefficients are the same number, which is why they are so often confused. They part company as soon as the table grows.

V = √(χ² / (n × (k−1))) where k is the smaller of the row and column counts. On a 2×2, k − 1 = 1 and the formula collapses to √(χ²/n), which is |φ|.

Above 2×2 that divisor is what keeps V inside 0 to 1, and phi has no such correction — the unadjusted √(χ²/n) exceeds 1 on larger tables, which is why phi is defined only for 2×2.

V also loses the sign. Phi is signed, so it says which direction the association runs; V is always non-negative, because direction has no meaning once a variable has more than two categories.

For anything larger than 2×2, use Cramér’s V. For a 2×2, either name is correct and the tool prints both so the identity is visible rather than asserted.

An empty row or column leaves φ undefined, not zero

If nobody was exposed, or nobody had the outcome, the denominator contains a zero and phi does not exist. Returning 0 in that case would be a claim the data cannot support.

Zero would mean “no association”, which is a finding. “Undefined” means the design produced no information about the association at all, which is a different situation.

A single empty CELL is fine. The second preset has c = 0 and phi is perfectly well defined; it is an empty row or column that breaks it.

An empty cell does make the chi-square approximation unreliable, though. With any expected count below about 5, Fisher’s exact test is the right test even though phi remains the right effect size.

The tool returns no result rather than a number in the undefined case, which is the only honest output.

Reporting a phi coefficient

Four things, and the second is the one that separates a real report from a number.

Give the full 2×2 table. It is four integers and it lets a reader compute anything else they want, including the ceiling.

Give the ceiling, or at least the marginal proportions. “φ = 0.33, at its maximum for these margins” and “φ = 0.33” describe completely different findings.

Give chi-square with its p-value if you are testing, and use Fisher’s exact test instead when any expected count is small.

And say which category you coded as 1 in each variable. The sign of phi depends on the coding, and reverses if you flip either variable.

Sources and methodology

References for the phi coefficient and its marginal ceiling.

Method. Phi is computed from the four cell counts, and Pearson’s r is computed independently on the two expanded 0/1 variables — so the identity between them is a check on every table rather than a claim made once. The ceiling is computed by rearranging the counts into the most extreme table the same row and column totals permit, which is what makes the central example exact: on [10, 40, 0, 50] both φ and maxφ are 1/3 to machine precision, so the association is provably at its maximum rather than merely described that way. The φ² × n = χ² identity and the equality with Cramér’s V on a 2×2 are both asserted numerically across randomly generated tables. An empty row or column returns no result rather than zero. 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:

Cramer's VThe effect size a chi-square test does not give you, with your own table rescaled six ways: the same 3x3 pattern gives V = 0.27136852 at n = 90 and at n = 1,800 while p falls from 0.0101 to 3.6e-56.
Chi-SquareGoodness of fit and tests of independence with every expected count and per-cell contribution shown — because the validity condition is about expected counts, not observed ones, and most calculators hide them.
Odds RatioOdds ratio, relative risk, risk difference and number needed to treat from one 2x2 table — because an odds ratio of 6.00 can describe a relative risk of 1.50.
Relative RiskRisk ratio and odds ratio from one table with the divergence between them plotted: they agree to half a percent at a 1% baseline, and at an 80% baseline the odds ratio is exactly half the risk ratio.
Fisher's Exact TestThe exact p for a 2×2 table under all three two-sided conventions, because they disagree — 0.0406 against 0.0699 on the built-in table, across the 5% line — plus the test's actual size by enumeration, which is 2.30% at a nominal 5%.
Point-Biserial Correlationr with Cohen's d, t and Pearson's r on the same columns computed independently, plus the split table: hold d at 1.9799 and r falls from 0.707107 at 50/50 to 0.269630 at 2/98.

More in Math, or browse all calculators.

Educational use disclaimer

An educational tool. The phi coefficient is bounded below 1 whenever the row and column splits differ, so a small value can mean a complete association in a table with unequal margins rather than a weak one — read it against the ceiling this tool prints, and prefer the odds ratio when comparing across tables with different marginal structures.

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 2x2 association coefficient that prints the ceiling its marginals impose beside every result.
  2. Built the page on a table that makes the ceiling unarguable: on [10, 40, 0, 50] every single case is exposed — as complete an association as those totals can hold — and phi is 0.3333333, which is EXACTLY max phi. Calling that a weak association reads the margins rather than the data.
  3. Contrasted it with [10, 0, 0, 90], where the row and column splits match and phi reaches 1 exactly, so the difference between 0.33 and 1.00 is visibly marginal structure rather than strength.
  4. Verified the phi^2 x n = chi-square identity and the equality with Cramer's V on 2x2 tables numerically across randomly generated tables, and computed Pearson's r on the expanded 0/1 variables as an independent check.
  5. Returned no result rather than zero for an empty row or column, since undefined and 'no association' are different findings. Verified against 69 assertions.

Add this calculator to your site

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