Chi-Square Calculator

Calculate chi-square statistic and p-value from a 2×2 contingency table.

By Konstantin Iakovlev · Updated April 2026 · Source: Khan Academy

Chi-Square

16.6667

p-value

0.0000

Results

Chi-Square Statistic16.6667
p-value (approx)0.0000
Degrees of Freedom1
Significance (α=0.05)Highly Significant
Expected [1,1]30.00
Expected [1,2]20.00
Expected [2,1]30.00
Expected [2,2]20.00

Use the Chi-Square Calculator above to calculate your results. Enter your values and see instant results — all calculations run in your browser.

Disclaimer: This calculator is for informational purposes only and does not constitute tax, financial, or legal advice. Results are estimates based on the information you provide and current rates. Always consult a qualified tax professional or financial advisor for advice specific to your situation.

How It Works

A Chi-Square test on a 2x2 contingency table tells you whether two categorical variables are genuinely associated or merely appear linked by chance. The question shows up everywhere in 2026: a market researcher might ask whether a new ad campaign (variable 1) shifts customer purchase intent (variable 2), while a clinical team might test whether a treatment outperforms a placebo on a particular patient outcome.

Computation runs on the formula Σ((Observed - Expected)² / Expected). For every cell, the expected frequency comes from (Row Total × Column Total) / Grand Total, representing what you would see if the two variables had no relationship at all. Summing the standardized gaps between observed and expected counts produces the χ² statistic, which in turn yields a p-value, the probability of seeing an association this strong purely by chance when no real relationship exists.

Treat statistical significance and effect size as separate questions, because a small p-value signals only that the association is unlikely to be random, never that it is large or practically meaningful. The test also rests on having enough data in each cell. When more than 20% of cells carry expected counts below 5, the test's assumptions break down and the resulting p-values can no longer be trusted.

Example: Analyzing Customer Preference for a New Product Feature

  1. 1 A tech company, 'InnovateCorp,' surveyed 500 potential customers in Q1 2026 to see if their gender influences preference for a new AI-powered product feature. The results were: 150 men preferred the feature, 100 men did not; 120 women preferred the feature, 130 women did not. Input these values into the 2x2 table.
  2. 2 Input: Preferred (Men: 150, Women: 120), Not Preferred (Men: 100, Women: 130). The calculator will compute expected values. For instance, Expected (Men, Preferred) = (250 * 270) / 500 = 135.
  3. 3 The calculated Chi-Square (χ²) statistic is 8.01. This value reflects the discrepancy between the observed and expected frequencies under the assumption of no association.
  4. 4 The p-value is 0.0046. Since 0.0046 is less than the common significance level of 0.05, InnovateCorp can conclude with 95% confidence that there is a statistically significant association between gender and preference for the new AI-powered product feature among their potential customers in Q1 2026.

Source: Khan Academy · Last updated: April 2026

Frequently Asked Questions

When do you use a chi-square test?
Use chi-square to test whether two categorical variables are independent. Common examples: testing if gender affects product preference, if treatment groups have different outcomes, or if survey responses differ by age group.
How do you interpret a chi-square p-value?
A p-value below 0.05 indicates a statistically significant association between the variables (reject the null hypothesis of independence). A p-value above 0.05 suggests no significant association was found.
What is the chi-square formula?
Chi-square = sum of [(observed - expected)² / expected] for each cell. Expected values are calculated as (row total x column total) / grand total. Degrees of freedom = (rows-1) x (columns-1).