InputTestHub

Chi-Square Calculator

Runs a chi-square goodness-of-fit or independence test on your counts, with expected values, degrees of freedom, p-value and Cramér's V.

Calculators Nothing uploaded No sign-up Free, unlimited
Calculators tool
Leave empty to test against an equal split. Ratios are scaled to the observed total.
One row per line, used for the independence test.
Enter your figures and press Calculate.
In short A chi-square test compares counts you observed with counts you would expect, and sums (observed − expected)² ÷ expected across every category. Rolling a die 60 times and getting 16, 8, 10, 10, 8, 8 gives χ² = 4.80 on 5 degrees of freedom and p = 0.4408 — nothing unusual, despite one face appearing 60% more often than it should. That is the useful lesson: eyeballing counts overstates how surprising they are. There are two tests here. Goodness of fit checks one set of counts against a hypothesis, with degrees of freedom one less than the number of categories. Independence checks whether two variables in a contingency table are related, with (rows − 1) × (columns − 1) degrees of freedom; the expected counts come from the row and column totals, and they reproduce those totals exactly, which is what "expected" means. Three cautions. The statistic grows in direct proportion to the sample size, so the same percentages with ten times the data give ten times the χ² — a significant result is not by itself an important one, which is why Cramér's V is printed as the effect size. The approximation needs reasonably large expected counts; the usual rule is at least 5, and for a small 2×2 table Fisher's exact test is the honest choice. And a significant result says the rows and columns are not independent. It does not say which way the effect runs, and it certainly does not say one causes the other.

How to use the Chi-Square Calculator

  1. Enter your figures in the input fields.
  2. The result updates as you type, together with the full working.
  3. Check the breakdown table to see exactly how the number was reached.

About the Chi-Square Calculator

Chi-square goodness-of-fit and independence tests, with expected counts and an effect size.

What people use it for

  • Testing whether counts match an expected distribution.
  • Testing whether two categorical variables are related.
  • Checking whether a die, a randomiser or a process is fair.

Details

Critical χ² at 0.05, 1 df3.8415
Critical χ² at 0.05, 2 df5.9915
Goodness-of-fit degrees of freedomcategories − 1
Independence degrees of freedom(rows − 1) × (columns − 1)
Expected counts should be at least5, or the approximation drifts

The maths behind it

This tool uses χ² = Σ (observed − expected)² ÷ expected, on k − 1 df for goodness of fit or (r − 1)(c − 1) for independence. Every intermediate value is shown on screen, so the result can be checked by hand.

For a 2×2 table the page also computes χ² by the closed form n(ad − bc)² ÷ (row and column products) and prints both, so two independent routes to the same number are visible.

Where this tool stops

Chi-square works on COUNTS, never on percentages or averages — feeding it percentages silently gives a meaningless answer. It also assumes each observation falls in exactly one cell and that the observations are independent.

Frequently asked questions

What if my expected counts are below 5?
The χ² distribution is an approximation that relies on reasonably large expected counts, and below 5 the p-value drifts. For a small 2×2 table, Fisher's exact test is the standard alternative; the page warns you when any expected count is too small.
Can I enter expected values as percentages or ratios?
Yes. If they do not sum to the observed total they are scaled to it, so 1, 1, 2 and 25, 25, 50 give the same answer on 100 observations.
Why does my result become significant with more data?
Because χ² is proportional to the sample size while the percentages stay put. That is why the effect size, Cramér's V, is reported next to it — V does not grow with n.
Does a significant result mean one variable causes the other?
No. It means the two are not independent. Direction and cause are separate questions that this test cannot address.
Is the Chi-Square Calculator free?
It is free, with no account, no trial and no daily cap. Every calculators tool on inputtesthub.com works the same way: open the page and use it.
Is the Chi-Square Calculator safe to use with private information?
No. The Chi-Square Calculator runs entirely in your browser using JavaScript. Because the work happens locally, the utility also keeps working if your connection drops, and closing the tab is all it takes to discard everything.
What is the equation behind the Chi-Square Calculator?
It uses χ² = Σ (observed − expected)² ÷ expected, on k − 1 df for goodness of fit or (r − 1)(c − 1) for independence. The full working is printed under the result, so you can follow every step rather than trusting a black box.
What does a typical result look like?
Enter 16, 8, 10, 10, 8, 8 against an equal split and the Chi-Square Calculator returns χ² = 4.80, 5 df, p = 0.4408.
Who is the Chi-Square Calculator for?
The most common reasons people reach for it: testing whether counts match an expected distribution. Testing whether two categorical variables are related. Checking whether a die, a randomiser or a process is fair. It is built for exactly those cases rather than being a general-purpose tool with this bolted on.
Is there anything the Chi-Square Calculator cannot do?
Chi-square works on COUNTS, never on percentages or averages — feeding it percentages silently gives a meaningless answer. It also assumes each observation falls in exactly one cell and that the observations are independent. Knowing where a tool stops being trustworthy matters more than the cases where it works.
What figures does the Chi-Square Calculator work from?
Critical χ² at 0.05, 1 df is 3.8415. Critical χ² at 0.05, 2 df is 5.9915. Goodness-of-fit degrees of freedom is categories − 1. These are printed on the page itself, so you do not have to take them on trust.
Is the number rounded?
The calculation runs in double precision and the result is shown to ten significant figures, so converting a value and converting it back returns the original. What is displayed is rounded for readability; what is copied is not.

Related calculators tools

All 382
01

Loan Calculator

Works out the monthly payment, total interest and full repayment schedule for any loan from…

02

EMI Calculator

Calculates your Equated Monthly Instalment with a full principal-versus-interest breakdown and…

03

Mortgage Calculator

Estimates a full monthly housing payment including principal, interest, property tax…

04

Car Loan Calculator

Calculates a car finance payment from the price, deposit, trade-in, interest rate and term…

05

Personal Loan Calculator

Works out instalments and total cost for an unsecured personal loan, including any processing…

09

SIP Calculator

Projects the maturity value of a monthly Systematic Investment Plan, showing invested amount…