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 PickerFPS ConverterInstagram User ID LookupLine CounterSort NumbersRelative Standard Deviation CalculatorBatting Average CalculatorMAC Address GeneratorRemove SpacesERA CalculatorJob FinderWord to Phone Number ConverterFeet and Inches to Cm ConverterMAC Address LookupRandom Truth or Dare GeneratorFacebook User ID LookupSum CalculatorPercent Off CalculatorSquare Root (√) CalculatorSun, Moon & Rising Sign Calculator 🌞🌙✨OPS CalculatorSHA256 Hash GeneratorLog Base 10 CalculatorImage ResizerMP3 LooperBitwise CalculatorNumber of Digits CalculatorSaturn Return CalculatorAudio SplitterPhone Number ExtractorSlope and Grade CalculatorRandom Credit Card GeneratorVertical Jump CalculatorRoman Numerals ConverterAI Text HumanizerRandom Sound Frequency GeneratorSlugging Percentage CalculatorRandom Activity GeneratorOn Base Percentage CalculatorSalary Conversion CalculatorCm to Feet and Inches ConverterRandom IMEI GeneratorRandom Movie PickerInvisible Text GeneratorMerge VideosNumber to Word ConverterWAR Calculator⬛ Aspect Ratio CalculatorOctal CalculatorCaffeine Overdose CalculatorRandom Fake Address GeneratorBinary to Gray Code ConverterRandom Superpower GeneratorRandom Poker Hand GeneratorDecimal to BCD ConverterFile Size ConverterRandom Loadout GeneratorMaster Number CalculatorText FormatterRandom Quote GeneratorVideo to Image ExtractorAdd Prefix and Suffix to TextRandom Writing Prompt GeneratorBCD to Decimal ConverterFirst n Digits of PiSteel Weight CalculatorRandom Birthday GeneratorWHIP CalculatorTime Duration CalculatorCompound Growth CalculatorLove Compatibility CalculatorWord Ladder GeneratorQuotient and Remainder CalculatorCompare Two StringsYouTube Channel StatisticsName Number CalculatorCM to Inches ConverterSHA512 Hash GeneratorOutlier CalculatorBattery Life CalculatorImage CompressorDMS to Decimal Degrees ConverterWhat is my Lucky Number?Remove AccentPercent Growth Rate CalculatorGray Code to Binary ConverterLeap Years ListRemove Line Breaks📅 Date CalculatorStair CalculatorAcreage CalculatorDay of Year CalendarVideo CompressorProportion CalculatorBinary to BCD ConverterSocial Media Username CheckerIP Subnet CalculatorRandom Number PickerEmail ExtractorURL ExtractorAI ParaphraserAI Punctuation AdderList of Prime NumbersDay of the Year Calculator - What Day of the Year Is It Today?IP 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 ConverterNumber ExtractorAngel Number CalculatorLog Base 2 CalculatorRoot Mean Square CalculatorSum of Positive Integers CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderLbs to Kg ConverterHex to Decimal ConverterRandom Group GeneratorConvolution CalculatorMAC Address AnalyzerRandom String GeneratorRemove Leading Trailing SpacesAmortization CalculatorMarkup CalculatorPVIF 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 OptimizerCTR 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 ReferenceClothing Size ConverterGas 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 CalculatorGravel, Sand & Topsoil CalculatorRandom Sentence GeneratorRandom Paragraph GeneratorRandom Math Problem GeneratorRandom Bible Verse GeneratorRandom Cat/Dog Name GeneratorRandom Debate Topic GeneratorBody Recomposition CalculatorAlcohol Calorie CalculatorMedication Dosage CalculatorPace to Calories CalculatorHydration CalculatorTrain Meeting Problem SolverAge Word Problem SolverMixture Problem SolverWork Rate Problem SolverDistance-Speed-Time Triangle CalculatorCoin Word Problem SolverNumber Bonds GeneratorCarry and Borrow VisualizerTimes Tables QuizMental Math TrainerRoman Numeral Math SolverEgyptian Multiplication CalculatorVedic Math Tricks CalculatorRussian Peasant MultiplicationSoroban Abacus SimulatorAnnuity Payout CalculatorReverse Mortgage CalculatorVariable Annuity CalculatorFixed Indexed Annuity CalculatorBond Convexity CalculatorBond Duration Calculator (Macaulay & Modified)Forward Rate CalculatorMortgage Recast CalculatorTreasury Inflation-Protected Securities (TIPS) CalculatorStock Beta CalculatorTreynor Ratio CalculatorSortino Ratio CalculatorDoppler Effect CalculatorSpring Constant CalculatorPendulum Period CalculatorCentripetal Force CalculatorAngular Velocity CalculatorMoment of Inertia CalculatorSnell's Law CalculatorCoulomb's Law CalculatorElectric Field CalculatorMagnetic Field of Wire CalculatorLens Equation CalculatorA/B Test Significance CalculatorA/B Test Sample Size CalculatorConversion Rate CalculatorCustomer Lifetime Value (CLV) CalculatorCustomer Acquisition Cost (CAC) CalculatorChurn Rate CalculatorRetention Rate Cohort CalculatorNPS (Net Promoter Score) CalculatorPareto Chart GeneratorSix Sigma Process Capability CalculatorTessellation GeneratorSpirograph GeneratorVoronoi Diagram GeneratorDelaunay Triangulation GeneratorL-System Fractal GeneratorMandelbrot Set ExplorerJulia Set GeneratorPolar Equation Plotter3D Surface PlotterSierpinski Triangle GeneratorcURL Command BuilderHTTP Status Code ReferenceUUID Validator/DecoderURL ParserQuery String BuilderSVG to React/JSX ConverterSCSS to CSS CompilerLess to CSS CompilerTypeScript PlaygroundJSON Schema GeneratorImage to ASCII Art ConverterImage to SVG TracerLipogram CheckerPangram CheckerAcronym GeneratorBackronym GeneratorPig Latin TranslatorEXIF Data Viewer/RemoverROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability Editor