Tickbox

Free chi-square calculator for survey crosstabs

Paste a crosstab from a spreadsheet, or enter counts in a table. Get χ², the degrees of freedom, the p-value, the expected counts, Cramér's V and each calculation step. No signup. All processing is in your browser.

Copy the cells from a spreadsheet and paste them here. Headings for the rows and columns are optional. A total row or a total column with the heading “Total” is not used. If the text has no tabs, semicolons, commas or spaces separate the cells. If your headings are numbers, leave the top-left cell empty.

The threshold for the p-value is 1 minus the confidence level. At 95%, the threshold is 0.05.

What the chi-square test tells you

A crosstab shows the answers to one question, split by the answers to a second question. For example, the rows can be age groups and the columns can be the answers to “How likely are you to buy again?”. The chi-square test of independence examines if the answers to the two questions are related. If they are not related, each age group has the same distribution of answers, apart from random differences.

The test compares each observed count with the count that you expect if the two questions are not related. A large total difference gives a large χ² and a small p-value. If the p-value is less than your threshold, the result is statistically significant.

How to read a survey crosstab

  1. Use counts, not percentages. The test needs the number of responses in each cell.
  2. Read the percentages in the direction of the groups. If your groups are the columns, compare the column percentages across a row. The calculator shows column percentages or row percentages under the observed counts.
  3. Look at the p-value first. If the result is not significant, the differences in the table can be random. Do not make a decision from one large percentage.
  4. If the result is significant, find the cells that cause it. Look at the adjusted residuals. A value above 1.96 or below −1.96 is a cell with many more or many fewer responses than expected. In a large table, some cells pass this limit by chance, so look for a pattern and not one cell.
  5. Look at the size of the effect. Cramér's V is 0 when there is no association and 1 when one question decides the answer to the other completely. A large sample can make a small difference significant, so a significant result with a small V can be a difference that is too small to change what you do.
  6. Check the expected counts. If many expected counts are small, combine small categories or collect more responses. The calculator shows a warning if an expected count is below 5.

The test assumes that each person is in one cell only, and that the responses are independent. Do not use it for a question where people can select more than one answer, or to compare two answers from the same people. If your survey uses weights, the counts are not the real number of responses, and this test is not correct for them.

Method

The calculator does Pearson's chi-square test of independence with no continuity correction. It does these calculations:

Expected count = row total × column total ÷ N

χ² = Σ (observed − expected)² ÷ expected

Degrees of freedom = (rows − 1) × (columns − 1)

p-value = probability that a chi-square value with these degrees of freedom is χ² or more

Cramér's V = √(χ² ÷ (N × (smaller number of rows or columns − 1)))

Adjusted residual = (observed − expected) ÷ √(expected × (1 − row total ÷ N) × (1 − column total ÷ N))

N is the total number of responses. The results agree with SciPy chi2_contingency with correction=False. The calculator is tested against SciPy and statsmodels on six tables, and against the hair and eye colour example of the Cornell Statistical Consulting Unit.

Confidence levelp-value threshold
90%0.10
95%0.05
99%0.01

Worked example

You ask 100 people if they will buy again. 50 people came from email and 50 people came from social media. From email, 30 say Yes and 20 say No. From social media, 20 say Yes and 30 say No.

YesNoTotal
Email302050
Social media203050
Total5050100
  1. Expected count of each cell: 50 × 50 ÷ 100 = 25
  2. Contribution of each cell: (30 − 25)² ÷ 25 = 1, and (20 − 25)² ÷ 25 = 1
  3. χ² = 1 + 1 + 1 + 1 = 4
  4. Degrees of freedom = (2 − 1) × (2 − 1) = 1
  5. A chi-square value of 4 with 1 degree of freedom gives a p-value of 0.0455. At 95% confidence, 0.0455 is less than 0.05, so the result is significant. At 99% confidence, it is not significant.
  6. Cramér's V = √(4 ÷ (100 × 1)) = 0.20

How to use the calculator

  1. Copy the crosstab from your spreadsheet and paste it. Or select Enter counts, select the number of rows and columns, and enter the counts.
  2. Select the confidence level.
  3. Select Calculate chi-square. Read the result, the tables and the calculation steps. If an entry is not valid, a message tells you what to correct.

Chi-square calculator FAQ

What does a chi-square test tell me about a survey?

It tells you if the answers to one question are different between the groups of another question, for example if satisfaction is different between age groups. A small p-value means that the differences in your counts are larger than random sampling usually gives.

Can I use percentages?

No. Enter the number of responses in each cell. The same percentages from 50 people and from 5,000 people give very different results, so the test needs the counts.

What if an expected count is below 5?

The calculator shows a warning, because the p-value can be inaccurate. You can combine small categories, for example two age groups, or collect more responses. For a 2 × 2 table, you can use Fisher's exact test.

Does the calculator use the Yates correction?

No. It gives Pearson's chi-square with no continuity correction, for all table sizes. The result agrees with SciPy chi2_contingency with correction=False.

Can I test a question where people select more than one answer?

Not with this test. Each person must be in one cell only. If a person can select many answers, test each answer as a separate Yes or No column.

Does a significant result mean that one group causes the difference?

No. The test shows an association between two questions. It does not show the cause. Also, a very large sample can make a small difference significant. Look at Cramér's V and the percentages to see the size of the difference.

Is my data sent to a server?

No. The calculation runs in your browser, and this page does not send or save your numbers. The site uses Plausible analytics to count page visits. Plausible does not receive what you enter.

Do I need an account?

No. The calculator is free and needs no signup.

Related pages

Sources