Chi-Square Test Calculator (Independence and Goodness of Fit)

Run a chi-square test of independence on a table of counts or a goodness-of-fit test.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Step 1: Open Chi-Square Test Calculator (Independence and Goodness of Fit) and add your input

    Type your numbers or text, add your file, or pick the options you need. Nothing is uploaded: everything stays in your browser.

  2. 2
    Step 2: What Chi-Square Test Calculator (Independence and Goodness of Fit) does

    Run a chi-square test of independence on a table of counts or a goodness-of-fit test.

  3. 3
    Step 3: Read the result and compare

    The result appears at once. Change one value to see how the answer moves, then keep the figure that fits your case.

  4. 4
    Step 4: Copy or save it

    Copy the result or download it. For an important decision, confirm it with the official source or an adviser.

About this tool

For a test of independence, type the observed counts with one row of the table per line. For goodness of fit, enter the observed counts and optionally the expected counts or proportions. The calculator gives the chi-square statistic, degrees of freedom, p-value and, for tables, Cramér's V.

Independence

The expected count in each cell is row total × column total ÷ grand total. Chi-square = Σ (observed − expected)² ÷ expected, with (rows − 1) × (columns − 1) degrees of freedom. A small p-value suggests the two categorical variables are related. Cramér's V measures the strength from 0 to 1.

Goodness of fit

Compares observed counts with expected counts. With no expected values the categories are assumed equally likely.

Requirements

Counts, not percentages. Expected counts should be at least 5 in most cells; otherwise use an exact test.

Worked example

The table 30 20 10 / 20 30 40 has chi-square 16.67 on 2 degrees of freedom, p = 0.0002 and Cramér's V of 0.33. Observed counts 18 22 20 25 15 against equal expectations give chi-square 2.9 on 4 degrees of freedom.

Tips for best results

Check every box before you rely on a result, because one wrong digit changes the whole answer. Use the exact figures from your payslip, bill, certificate or contract, and keep a note of the date you calculated. Rates, thresholds and rules change from time to time, so for tax, fees and legal matters treat the output as an estimate and confirm with the official source named on this page. You can run as many scenarios as you like; nothing is saved or sent, and refreshing the page clears the boxes.

Quick facts

Embed this calculator on your site

Copy this code to show the calculator on your own page. A link back to shobfree.com is included.

Frequently asked questions

Can I enter percentages?

No, use counts.

What does Cramér's V mean?

The strength of association: 0.1 small, 0.3 medium, 0.5 large for many tables.

When is the test not valid?

When many expected counts are below 5.

How do I enter the table?

One row per line, numbers separated by spaces.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages