← All text tools

2x2 Table Calculator

From the four counts of a 2x2 table gives the odds ratio, relative risk, risk difference and number needed to treat, with confidence intervals and the Fisher exact p-value.

  • Free
  • No sign-up
  • Works on any device

About 2x2 Table Calculator

Enter the four counts of a 2x2 table: group 1 with and without the outcome, group 2 with and without it. The calculator returns the odds ratio, relative risk, risk difference and number needed to treat, each with a confidence interval, and tests the table with the Fisher exact test and the chi-square test with and without Yates correction. With 10 of 30 in group 1 and 5 of 45 in group 2, the odds ratio is 4, the relative risk 3, the risk difference 0.2222, the NNT 4.5 and the Fisher two-sided p-value 0.0365.

How to use 2x2 Table Calculator

  1. Type the counts a and b for group 1 and c and d for group 2.
  2. Choose the confidence level.
  3. Read the ratios, intervals and p-values, and check the notes about small or zero cells.

Why use this tool?

Also known as

Frequently asked questions

What is the difference between odds ratio and relative risk?

The relative risk compares the probabilities of the outcome in the two groups, the odds ratio compares their odds. They are close when the outcome is rare and diverge when it is common.

What does the number needed to treat mean?

It is 1 divided by the absolute risk difference: how many people must receive the treatment for one extra person to have the outcome. It is called number needed to harm when the outcome is bad.

What if one of my cells is zero?

The ratios and their intervals then cannot be calculated, so the tool adds 0.5 to every cell for those two figures only. The Fisher test and risk difference use your original counts.

Is 2x2 Table Calculator free?

Yes. 2x2 Table Calculator on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put 2x2 Table Calculator on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.