Simplify Your Workflow: Search MiniWebtool.
Add Extension
Home Page > Math > Statistics And Data Analysis > Contingency Table Calculator

Contingency Table Calculator

Analyze categorical data relationships with the chi-square test of independence. Supports any R×C contingency table with expected frequencies, standardized residuals, Cramér's V effect size, animated mosaic plot, residual heatmap, and step-by-step solutions.

Contingency Table Calculator
📌 Quick examples:
×

Embed Contingency Table Calculator Widget

About Contingency Table Calculator

The Contingency Table Calculator performs the chi-square test of independence on any R×C contingency table (cross-tabulation). Enter your observed frequencies to test whether two categorical variables are statistically associated. Get detailed results including expected frequencies, adjusted standardized residuals, Cramér's V effect size, cell contribution analysis, interactive mosaic plots, residual heatmaps, chi-square distribution curves, and a complete step-by-step solution.

How to Use the Contingency Table Calculator

  1. Set table dimensions — choose the number of rows and columns for your contingency table. The default is a 2×2 table, but you can analyze tables up to 10×10 using the dropdown selectors.
  2. Enter observed frequencies — type the observed count for each cell directly into the interactive grid. Alternatively, switch to "Text Input" mode to paste tab-separated or comma-separated data. All values must be non-negative whole numbers.
  3. Add labels (optional) — enter row and column category labels separated by commas. Labels make the output tables and charts easier to interpret. For example, "Male, Female" for rows and "Yes, No" for columns.
  4. Set significance level — choose your desired α level. The most common choice is 0.05 (95% confidence). Smaller α values (0.01, 0.001) require stronger evidence to declare significance.
  5. Analyze results — click "Analyze Contingency Table" to see the chi-square statistic, p-value, effect size measures, visualizations, and step-by-step solution.

What Is a Contingency Table?

A contingency table (also called a cross-tabulation, crosstab, or two-way frequency table) displays the joint frequency distribution of two categorical variables. Each row represents one category of the first variable, each column represents one category of the second variable, and each cell contains the count of observations falling into that specific combination. Contingency tables are the foundation for many categorical data analysis methods, including the chi-square test, Fisher's exact test, and log-linear models.

The Chi-Square Test of Independence

The chi-square (χ²) test of independence determines whether there is a statistically significant association between two categorical variables. It works by comparing the observed cell frequencies with the frequencies that would be expected if the variables were independent.

χ² = Σ (Oᵢⱼ − Eᵢⱼ)² / Eᵢⱼ

Where Oᵢⱼ is the observed frequency in cell (i,j), and Eᵢⱼ is the expected frequency calculated as:

Eᵢⱼ = (Row Total(i) × Column Total(j)) / Grand Total

The degrees of freedom for the test are (r − 1) × (c − 1), where r is the number of rows and c is the number of columns. A larger χ² value indicates a greater discrepancy between observed and expected frequencies, suggesting the variables are associated.

Cramér's V — Measuring Effect Size

While the p-value tells you whether an association exists, Cramér's V tells you how strong it is. Cramér's V ranges from 0 (no association) to 1 (perfect association) and is calculated as:

V = √(χ² / (N × (k − 1)))

Where N is the total sample size and k is the smaller of the number of rows or columns. The interpretation of Cramér's V depends on the degrees of freedom:

Effect Sizedf* = 1df* = 2df* ≥ 3
Negligible< 0.10< 0.07< 0.06
Small0.10 – 0.300.07 – 0.210.06 – 0.17
Medium0.30 – 0.500.21 – 0.350.17 – 0.29
Large≥ 0.50≥ 0.35≥ 0.29

*df* refers to min(rows, columns) − 1

Understanding Standardized Residuals

Adjusted standardized residuals reveal which specific cells contribute most to a significant chi-square result. A residual of +2.5 in a cell means that cell has 2.5 standard deviations more observations than expected under independence. Key thresholds are:

When to Use the Chi-Square Test

If expected counts are too low, consider combining categories, using Fisher's exact test (for 2×2 tables), or using exact tests or Monte Carlo simulation for larger tables.

Chi-Square Test vs. Fisher's Exact Test

FAQ

What is a contingency table?

A contingency table (also called a cross-tabulation or crosstab) is a table that displays the frequency distribution of two or more categorical variables. Each cell shows the count of observations that fall into a specific combination of categories. It is the foundation for testing whether the variables are independent or associated using the chi-square test.

What is the chi-square test of independence?

The chi-square test of independence determines whether there is a statistically significant association between two categorical variables in a contingency table. It compares observed cell frequencies with expected frequencies calculated under the assumption that the variables are independent. A large chi-square statistic relative to the degrees of freedom suggests the variables are associated.

What is Cramér's V and how do I interpret it?

Cramér's V is an effect size measure for the chi-square test, ranging from 0 (no association) to 1 (perfect association). For 2×2 tables, values below 0.10 are negligible, 0.10–0.30 is a small effect, 0.30–0.50 is medium, and above 0.50 is large. For larger tables the thresholds are proportionally lower. Unlike the p-value, Cramér's V measures the strength of association, not just whether it exists statistically.

What are standardized residuals in a contingency table?

Adjusted standardized residuals show how much each cell deviates from what would be expected under independence. Values greater than +1.96 or less than −1.96 indicate a significant departure at the 0.05 level. Positive residuals mean more observations than expected in that cell; negative residuals mean fewer. They help pinpoint which specific cell combinations drive the overall association.

When should I not use the chi-square test?

The chi-square test may be unreliable when expected frequencies are very low — specifically when more than 20% of expected counts fall below 5, or any expected count is below 1. For 2×2 tables with small samples, Fisher's exact test is preferred. The test also requires independent observations, so it should not be used with paired, matched, or repeated-measures data.

Reference this content, page, or tool as:

"Contingency Table Calculator" at https://MiniWebtool.com/contingency-table-calculator/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: 2026-04-15

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Related MiniWebtools:

Statistics And Data Analysis:

Top & Updated:

Random PickerRandom Name PickerBatting Average CalculatorLine CounterRelative Standard Deviation CalculatorFPS ConverterSort NumbersERA CalculatorMAC Address GeneratorRemove SpacesInstagram User ID LookupWord to Phone Number ConverterFacebook User ID LookupMAC Address LookupSum CalculatorFeet and Inches to Cm ConverterOPS CalculatorRandom Quote GeneratorRandom Truth or Dare GeneratorSHA256 Hash GeneratorPercent Off CalculatorBitwise CalculatorSquare Root (√) CalculatorVertical Jump CalculatorSalary Conversion CalculatorLog Base 10 CalculatorRoman Numerals ConverterNumber of Digits CalculatorSlope and Grade CalculatorOn Base Percentage CalculatorAudio SplitterSlugging Percentage CalculatorMP3 LooperSaturn Return CalculatorDoubling Time CalculatorPhone Number ExtractorCaffeine Overdose CalculatorJob FinderRandom IMEI GeneratorOne Rep Max (1RM) CalculatorMerge VideosClothing Size ConverterSun, Moon & Rising Sign Calculator 🌞🌙✨First n Digits of PiNumber to Word ConverterCompare Two StringsCompound Growth CalculatorAI Text HumanizerCm to Feet and Inches ConverterRandom Poker Hand GeneratorBinary to Gray Code ConverterRandom Birthday GeneratorDecimal to BCD ConverterRandom Fake Address GeneratorBCD to Decimal ConverterRandom Superpower GeneratorRandom Activity GeneratorWAR CalculatorOctal CalculatorAdd Prefix and Suffix to TextWHIP CalculatorGrade CalculatorRandom Movie PickerFile Size ConverterImage ResizerRandom Writing Prompt GeneratorVideo to Image ExtractorTime Duration CalculatorYouTube Channel StatisticsPercent Growth Rate CalculatorLove Compatibility CalculatorText FormatterQuotient and Remainder CalculatorRemove AccentDay of Year CalendarStair CalculatorCM to Inches ConverterInvisible Text GeneratorList of Prime NumbersRandom Loadout GeneratorOutlier CalculatorAdd Text to ImageArc Length CalculatorLeap Years ListRemove Leading Trailing SpacesSHA512 Hash GeneratorRandom Emoji GeneratorRandom Object GeneratorVideo CropperRandom Chess Opening GeneratorWord Ladder GeneratorGray Code to Binary ConverterConnect the Dots GeneratorRandom Number PickerNumber ExtractorImage CompressorAI ParaphraserCryptogram GeneratorRandom Group GeneratorEmail ExtractorURL ExtractorAI Punctuation AdderDay of the Year Calculator - What Day of the Year Is It Today?Video CompressorBinary to BCD ConverterIP Address to Hex ConverterSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterLottery Number GeneratorBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerBreak Line by CharactersAverage CalculatorModulo CalculatorPVIFA CalculatorReverse VideoHypotenuse CalculatorRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence Expander📅 Date CalculatorLbs to Kg ConverterHex to Decimal ConverterConvolution CalculatorMAC Address AnalyzerRandom String GeneratorAmortization CalculatorMarkup CalculatorPVIF CalculatorName Number CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerSocial Media Username CheckerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorBoiling Point CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorRelative Risk CalculatorEffect Size CalculatorPermutations with Repetition CalculatorModular Exponentiation CalculatorPrimitive Root CalculatorPerfect Number CheckerAmicable Number CheckerTwin Prime FinderMersenne Prime CheckerGoldbach Conjecture VerifierMöbius Function CalculatorEgyptian Fraction CalculatorFibonacci Number CheckerDigital Root CalculatorPartition Function CalculatorBoolean Algebra SimplifierKarnaugh Map (K-Map) SolverLogic Gate SimulatorGraph Coloring CalculatorTopological Sort CalculatorAdjacency Matrix CalculatorRecurrence Relation SolverInclusion-Exclusion CalculatorLinear Programming SolverTraveling Salesman Solver (TSP)Hamiltonian Path CheckerPlanar Graph CheckerNetwork Flow Calculator (Max Flow)Stable Marriage Problem SolverFirst-Order ODE SolverSecond-Order ODE SolverDirection Field / Slope Field PlotterEuler's Method CalculatorBernoulli ODE SolverSystem of ODEs SolverGroup Theory Order CalculatorRing and Field CalculatorJordan Normal Form CalculatorMatrix Exponential CalculatorTensor Product CalculatorFast Fourier Transform (FFT) CalculatorZ-Transform CalculatorNumerical Integration CalculatorTOML to JSON ConverterJSON to CSV ConverterXML to JSON ConverterSQL to MongoDB Query ConverterCSS Flexbox PlaygroundCSS Grid GeneratorJWT GeneratorBcrypt Hash Generator / CheckerColor Code Converter (All Formats)Git Command Generator.env File GeneratorLorem Picsum / Placeholder Image GeneratorText to Binary/Hex/ASCII ConverterSyllable CounterSentence CounterParagraph CounterSpeaking Time CalculatorReading Time CalculatorWhitespace VisualizerStrikethrough Text GeneratorTorque Converter (Nm, ft-lb, kgf-cm)Data Transfer Rate ConverterFuel Efficiency ConverterAstronomical Unit ConverterRing Size ConverterPaper Size ReferenceGas Mileage CalculatorEV Range CalculatorEV Charging Time Calculator0–60 / Quarter Mile CalculatorCar Lease CalculatorVehicle Towing Capacity CalculatorExposure Triangle CalculatorCrop Factor CalculatorMegapixel to Print Size CalculatorPhoto File Size EstimatorMusic BPM TapperMusic Key TransposerVideo Bitrate CalculatorSeed Germination Rate CalculatorFertilizer Calculator (NPK)Raised Bed Soil CalculatorFrost Date CalculatorLawn Fertilizer CalculatorCompost Calculator (C:N Ratio)Solar Panel CalculatorSolar ROI CalculatorHome Energy Audit CalculatorAppliance Energy Cost CalculatorWater Usage CalculatorElectricity Generation Cost CalculatorHeat Loss CalculatorFlight Distance CalculatorTravel Budget CalculatorJet Lag CalculatorPacking List GeneratorTip Splitter (Advanced)Lease vs Buy CalculatorHourly Rate Calculator (Freelancer)Invoice Late Fee CalculatorESPP CalculatorStock Split CalculatorOptions Probability CalculatorDollar to Gold ConverterBeam Load CalculatorPipe Flow CalculatorBolt Torque CalculatorSteel Weight CalculatorGravel, Sand & Topsoil Calculator