Site icon Codanics

Chi-Square Test Calculator (Contingency Table)

Chi-Square Calculator: free online tool by Codanics that runs in your browser
Statistics

Chi-Square Test Calculator: Independence, Goodness of Fit and Fisher's Exact Test

Test whether two categorical variables are related, such as gender and preferred treatment or variety and disease status, or whether observed counts match what you expected. Edit the table, and the results update as you type.

✅ No login needed100% freeRuns in your browserYour data stays on your device
Chi-Square Calculator✅ Free · no login📚 Cite this tool
Your data never leaves your PC. Your data is analysed on your own computer or phone, even when you upload a CSV or Excel file. Nothing is uploaded, stored or seen by Codanics, and no login is needed.
  • PriceFree, no login or sign-up needed
  • Your dataProcessed in your browser, never uploaded
  • Works onPhone, tablet or computer, any modern browser
  • Made byDr. Muhammad Aammar Tufail, Codanics
  • Published14 November 2026
  • Last updated16 November 2026

📚 How to cite this tool

This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.

Citation · APA 7th edition

Tufail, M. A. (2026). Chi-square calculator [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/chi-square-calculator/

In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)

The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 14 November 2026.

🚀 Follow Codanics channel on WhatsApp for more updatesNew free tools, scholarships, PhD positions and research tips, straight to your phone. Free lessons on YouTube too.

How to use the chi-square calculator

  1. For two categorical variables, stay on Test of independence. Choose the number of rows and columns and rename the labels.
  2. Type the counts (frequencies, not percentages) into the cells, or use Paste from Excel or Upload CSV / Excel. You can load a table of counts, or raw data with one row per person, which is cross-tabulated for you. Results update as you type.
  3. Check the expected counts. If many are below 5 in a 2×2 table, report Fisher’s exact test, which is calculated for you.
  4. For one variable compared with known or equal proportions, use the Goodness of fit tab.
  5. Copy the APA sentence and look at the residuals to see which cells drive the association.

When to use a chi-square test

Use the chi-square test of independence when both variables are categorical and each person or sample is counted once, for example smoker or non-smoker against lung disease yes or no. Use the goodness-of-fit test when you have one categorical variable and want to compare it with a theoretical distribution, such as a 9:3:3:1 Mendelian ratio or equal preference for four brands.

Formulas

Expected count Eᵢⱼ = (row totalᵢ × column totalⱼ) / N Chi-square χ² = Σ (Oᵢⱼ − Eᵢⱼ)² / Eᵢⱼ, df = (r − 1)(c − 1) Yates (2×2) χ² = Σ (|O − E| − 0.5)² / E Cramér’s V V = √( χ² / (N × min(r − 1, c − 1)) ) Adjusted residual (O − E) / √( E (1 − rowᵢ/N)(1 − colⱼ/N) ) Fisher’s exact sum of hypergeometric probabilities ≤ P(observed table), two-sided

Assumptions

  • The data are counts, not percentages or means.
  • Each observation falls in exactly one cell, and observations are independent. For before-and-after yes/no data, use McNemar’s test instead.
  • No more than 20% of expected counts are below 5, and none is below 1.
Effect size matters. With a big sample, even a tiny association becomes “significant”. Report Cramér’s V: about 0.1 is small, 0.3 medium and 0.5 large (for df = 1).
Learn the statistics behind these numbers. Codanics has free statistics, R and Python lessons on YouTube and full courses for researchers.

Frequently asked questions

Can I enter percentages in a chi-square test?

No. The chi-square test needs raw counts. If you only have percentages, multiply them by the group size to get counts first.

When should I use Fisher's exact test instead of chi-square?

Use Fisher’s exact test for a 2×2 table when any expected count is below 5, which usually happens with small samples. This calculator shows Fisher’s p automatically for every 2×2 table.

Should I use Yates' continuity correction?

Yates’ correction makes the 2×2 chi-square more conservative. Many statisticians now prefer to report the uncorrected chi-square for large samples and Fisher’s exact test for small ones. If your supervisor or journal asks for Yates, tick the box.

How do I report a chi-square test in APA format?

Write χ²(df, N = total) = value, p = value, followed by an effect size, for example: χ²(1, N = 80) = 11.43, p < .001, φ = .38.

What do the standardized residuals mean?

They show which cells contribute most to a significant result. A residual above +1.96 means more observations than expected, and below −1.96 means fewer, at roughly the 5% level.

Is my data private?

Yes. All calculations happen in your browser.

Do I need to log in or create an account to use the chi-square calculator?

No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.

How do I cite this tool in my thesis or paper?

Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Chi-square calculator [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/chi-square-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.

Free guides and courses from Codanics

More free tools

See all free Codanics tools → · Codanics on YouTube · WhatsApp channel

Made by Dr. Muhammad Aammar Tufail, Codanics. First published 14 November 2026, last updated 16 November 2026. Found a bug or have an idea for a new tool? Tell us on the WhatsApp channel or in the comments on YouTube. Results are for learning and planning; check important analyses with a statistician or your supervisor.
Exit mobile version