Goal
Tests counts against expected counts with the Pearson chi-square statistic.
Worldwide context
Saved once here, used across the site.
Currency changes display only. Country selection guides tax input; no tax rate is guessed.
Tests counts against expected counts with the Pearson chi-square statistic.
χ² = Σ(O−E)²/E; df = categories − 1.A clearer path to an answer
This page keeps the calculation transparent: define the goal, enter the matching values, inspect the method, and decide what the result means in your situation.
Tests counts against expected counts with the Pearson chi-square statistic.
Observed counts · Expected counts
χ² = Σ(O−E)²/E; df = categories − 1.
Calculate, review the assumptions below, then compare a related tool when the decision needs more context.
Tests counts against expected counts with the Pearson chi-square statistic.
Open the Chi-Square Goodness of Fit pageMore statistics tools
Download PDFDownload Word (.doc)
Enter your values above and choose Calculate to see the result here.
Calculation map
χ² = Σ(O−E)²/E; df = categories − 1.
Bounded, transparent calculation
Your recent runs stay in this browser session only.
Formula: χ² = Σ(O−E)²/E; df = categories − 1.
Sums squared standardized residuals across categories. Larger values signal worse fit at df = categories − 1.
Worked example: χ² = 3.3333 with df = 2.
The displayed limits are checked before the handler runs. Model-specific domain checks may also reject impossible or non-finite inputs.
Methodology: This calculator follows the WorldCalculate input, formula, precision, and boundary policy. Read the official methodology.
Calculator usage statistics
This section counts anonymous successful Calculate submissions, not unique visitors. Counts and top tools appear only when trusted aggregate data is available; country analysis is shown only under the same condition and reporting threshold.
Answer-first guide
Tests counts against expected counts with the Pearson chi-square statistic. Start with one clearly defined goal, enter values in the units shown, and keep the result attached to the assumptions below.
This tool is useful when your question includes chi-square, goodness of fit, observed expected. It returns the outputs declared in the calculator contract rather than a live quote, approval, diagnosis, or professional sign-off.
Observed counts · Expected counts. Keep the same time period, unit system, and currency wherever the form requires comparable values.
Run the worked example first, compare its output with the page's example, then change one input at a time. This makes an unexpected result easier to trace to a unit, boundary, or assumption.
Need a wider view? Browse Statistics Calculators or compare the related tools below. The WorldCalculate methodology explains how formulas, examples, limits, and revisions are reviewed.
χ² = Σ(O−E)²/E; df = categories − 1.
Sums squared standardized residuals across categories. Larger values signal worse fit at df = categories − 1.
χ² = 3.3333 with df = 2.
Context and background
Statistics tools describe data or evaluate a stated probability model. They do not turn an observed summary into causation, certainty, or a forecast without additional evidence.
Data analysis developed from summaries of observations into probability, estimation, and decision measures. The essential habit remains the same: define the population, sample, variable, and convention before calculating.
Research and review
Researched by Hassan ALRowaie, Founder and editorial researcher at WorldCalculate.
This guide follows the live calculator's declared inputs, formula, worked example, assumptions, validation boundaries, and source-backed methodology. The review date describes editorial review of the calculator explanation; it is not a promise that external facts or rates remain current.
A chi-square goodness-of-fit calculation asks whether observed counts in one categorical variable are reasonably consistent with a specified set of expected counts. The categories might be outcomes of a die, response choices on a survey, defect types in a production sample, or any other mutually exclusive labels. The observed list records what happened. The expected list records what a proposed distribution predicts for the same categories and usually the same total number of observations. The calculation uses chi-square = sum((O-E)^2/E), where O is observed and E is expected for one category, and it reports degrees of freedom as categories - 1. This calculator is deliberately small and transparent: it parses two comma-separated count lists, checks their basic numeric contract, calculates one contribution per category, sums them, and returns the fixed degrees-of-freedom rule. It does not choose the expected model, calculate a p-value, or decide whether a scientific or practical claim is justified. The guide below explains how to frame the test, prepare the lists, derive the statistic, inspect contributions, handle assumptions and precision, and decide what additional analysis is needed.
A goodness-of-fit question compares one observed categorical distribution with one distribution stated in advance. Let the null hypothesis say that the category probabilities follow the proposed pattern. The expected counts are the counts that pattern would produce for the sample size at hand. The alternative hypothesis says that at least one category probability differs from the proposal. The test is about the whole distribution, not just whether one selected category is high or low.
The expected pattern can come from a physical law, a design specification, a claimed ratio, a historical baseline, a policy allocation, or a simple benchmark such as equal probabilities. The origin matters because it supplies the meaning of a disagreement. A statistic can be large because the model is wrong, because the sample is unusual, because the categories were defined poorly, or because the observations are dependent. The arithmetic cannot identify which explanation is responsible.
This procedure is for a single categorical variable. A flat observed list such as one count for each color does not contain the row and column structure needed to ask whether two categorical variables are associated. A contingency-table independence or homogeneity analysis is a different question with a different expected-count calculation and usually different degrees of freedom. Treating every chi-square expression as a goodness-of-fit test can produce a numerically neat but conceptually wrong result.
Before entering numbers, write the question in one sentence. State the variable, the categories, the proposed probabilities or counts, the sample size, and what would count as evidence against the proposal. If that sentence is unclear, the lists are not ready. A clear question also prevents changing the expected distribution after seeing the observed results merely to make the fit look better.
An observed count O_i is the number of sampled outcomes assigned to category i. An expected count E_i is the count predicted for that same category under the null model. The subscript is important: category 1 in the observed list must correspond to category 1 in the expected list, category 2 to category 2, and so on. The calculator has no category-label field, so list position is the only identity it can use.
Suppose the categories are red, blue, and green. The input observed = 12, 18, 10 and expected = 13, 15, 12 is meaningful only if both lists use exactly that order. Reordering one list changes every comparison while leaving the numbers themselves unchanged. A safe preparation habit is to make a small labeled table outside the calculator, sort neither list independently, and copy the rows from top to bottom into both fields.
Categories should normally be mutually exclusive and collectively exhaustive for the observations being analyzed. Each observation should contribute to one and only one listed category. If an outcome can belong to several categories, if some outcomes were discarded, or if an unclassified group was omitted, the observed total no longer represents the population described by the expected model. Add a defensible residual category or redesign the analysis rather than hiding the missing outcomes.
Expected counts are often built from expected probabilities. If the total observed sample size is N and the null probabilities are p_1 through p_k, then E_i = N times p_i. The expected probabilities should add to one, apart from harmless numerical rounding, so the expected counts add to N. An observed zero is allowed by this handler and can be meaningful. An expected zero is not allowed because the formula would divide by zero and because a structural-zero model needs separate reasoning.
Both fields are text fields intended for comma-separated numbers. The parser trims the overall input and splits on one or more commas or whitespace characters, so a value such as 10, 20, 30 and a value separated by spaces are read as the same three numeric tokens. Commas make the category boundaries easiest for a human to inspect. A blank field, an empty field, or a field containing no number is rejected before any statistic is computed.
Each token must be a complete decimal-style number. Signed values, decimal points, and scientific notation are accepted when they form a complete token, but arithmetic expressions, labels, currency marks, percent signs, and words are not expressions the parser evaluates. Values must be finite and within -1e12 through 1e12 before the category-specific checks are applied. The parser also limits each text field to 32,000 characters and each list to 1,000 numbers so accidental pastes cannot create an unbounded calculation.
The two parsed lists must have the same length, and that length must be at least two. Expected values must be strictly positive. Observed values must be zero or greater. The field accepts numeric decimals even though ordinary counts are integers; this is a property of the generic numeric parser, not a claim that fractional people or fractional physical events form a standard multinomial sample. A fractional entry can be appropriate for a weighted or normalized analysis only when the method behind that analysis supports it and the interpretation is documented.
The validator checks syntax, finite numeric range, list length, signs, and positivity. It does not verify category labels, total equality, probability normalization, integer status, random sampling, independence, or whether the expected values were chosen before the data. It also does not enforce the preferred 5+ expected-count guideline. Very small positive expected values can pass the positivity check but make the quotient numerically unstable or too large; the result guard rejects a nonfinite final statistic rather than silently replacing the input.
A validation error is useful information about the input contract, not evidence against the goodness-of-fit hypothesis. Fix the data preparation and rerun the calculation. Do not repair a missing token by inserting zero, do not move a value to a different position to satisfy the length check, and do not replace an invalid expected zero with a tiny arbitrary number merely to obtain an output. Those changes alter the analysis.
The expected list is a model, not a second measurement of the same event. It should be derived from the claim being examined. For a fair six-outcome device, equal expected probabilities produce six equal expected counts. For a known allocation ratio, multiply the total sample size by each ratio after normalizing the ratios to probabilities. For a historical reference, define which population and time period make the reference relevant before converting it to counts.
Check the expected total before entry. In the usual fixed-total goodness-of-fit setting, the expected counts should sum to the observed total N. If the proposed probabilities are p_i, the construction E_i = N times p_i guarantees this when the probabilities sum to one. If the expected values sum to a different total because they came from a forecast, exposure adjustment, or a separate data source, the formula can still produce a descriptive discrepancy, but the standard p-value interpretation and the df rule may no longer apply without a model that explains the different total.
Round expected counts only after they have been derived, and inspect the effect of that rounding. Small changes can matter when one expected value is small or when several categories are near their observed values. If rounded expected counts no longer have the intended total, decide whether the analysis should use unrounded values, a controlled rescaling, or a different method. Do not make a quiet correction after looking at the statistic.
If expected counts depend on parameters estimated from the observed sample, record that fact. Fitting a mean, a probability, or another parameter uses information from the data and consumes degrees of freedom in the corresponding inferential test. This calculator deliberately applies categories - 1, so its output should not be presented as a fully adjusted test when fitted parameters require a correction.
For one category, the raw discrepancy is O_i - E_i. A discrepancy of -5 and a discrepancy of +5 are equally far from expectation, so the method squares the difference. The squared discrepancy is then divided by E_i, giving the category contribution (O_i - E_i)^2 / E_i. The denominator puts differences on a scale related to the amount of variation expected in a count of that size; it also means that the same raw difference can matter more when the expected count is smaller.
The expression can be understood through a standardized residual. Define r_i = (O_i - E_i) divided by the square root of E_i. Squaring that residual gives r_i^2 = (O_i - E_i)^2 / E_i. Adding all category contributions produces chi-square = sum((O-E)^2/E). Every contribution is nonnegative, so the statistic is nonnegative. It is zero only when every observed count equals its expected count exactly.
The formula does not add raw differences because positive and negative deviations would cancel. It also does not divide by the observed count, because the null model supplies the reference scale. Using O in the denominator answers a different question and can behave badly for an observed zero. The order of the subtraction does not affect the total after squaring, but retaining the signed residual is useful when diagnosing which categories are overrepresented or underrepresented.
The calculator computes every contribution from the entered pair, sums the contributions, and reports the resulting statistic. It also exposes a breakdown so the total can be checked. That breakdown is arithmetic evidence: it shows which categories contribute most to the discrepancy. It is not, by itself, a collection of separate hypothesis tests for the individual categories.
If there are k categories and the sample total is fixed at N, the counts cannot vary independently in all k directions. Once k - 1 counts are known, the final count is determined by the total. This single sum constraint removes one free dimension, leaving k - 1 degrees of freedom. The same constraint is why observed cell counts in a multinomial sample are not literally independent of one another even though the observations that generated them can be independent.
For three categories, the output is df = 2. If the first two category counts change while the total stays fixed, the third must compensate. For six categories, the output is df = 5. Combining two categories reduces k and therefore changes the degrees of freedom; splitting one category increases k only if the split is scientifically defined before interpreting the result.
The handler always reports categories - 1. That is the stated contract for fixed expected counts. In a more general goodness-of-fit test, parameters estimated from the observations reduce the usable degrees of freedom further. If q independent parameters were fitted under the null model, a common adjusted expression is k - 1 - q, provided the assumptions and estimation procedure support that expression. The calculator does not know q and cannot make that adjustment.
Degrees of freedom are not a measure of sample quality and are not the number of categories that differ. They identify the reference chi-square distribution used when a p-value is computed under the stated model. A correct df value cannot rescue mismatched categories, sparse expected counts, dependent observations, or a model selected after inspecting the data.
The default lists are observed = 10, 20, 30 and expected = 15, 15, 30. There are three categories, and both totals are 60, so the fixed-total setup is internally consistent. Category 1 is five below expectation, category 2 is five above expectation, and category 3 matches expectation exactly. The signs differ, but the two five-count deviations should both contribute evidence of discrepancy rather than cancel.
For category 1, the contribution is (10 - 15)^2 / 15 = 25 / 15 = 1.6667 when displayed to four decimal places. For category 2, the contribution is (20 - 15)^2 / 15 = 25 / 15 = 1.6667. For category 3, the contribution is (30 - 30)^2 / 30 = 0. Adding them gives chi-square = 1.6667 + 1.6667 + 0 = 3.3333, subject to display rounding.
The degrees of freedom are 3 - 1 = 2. The output therefore reads chi-square = 3.3333 with df = 2. The statistic says that the observed list has a measurable discrepancy from the expected list, with the first two categories supplying all of the displayed contribution. It does not yet say whether that discrepancy is unusual enough to reject the proposed distribution.
For orientation only, if the fixed expected model and the sampling assumptions are appropriate, the upper-tail probability for a chi-square value of 3.3333 with 2 degrees of freedom is about 0.189. That probability is not calculated by this handler; it is an additional inferential step. The example illustrates why a statistic and a decision should be reported separately.
Consider four categories with observed counts 18, 12, 20, 10 and equal expected counts 15, 15, 15, 15. Both totals are 60. The contributions are 9/15 = 0.6000, 9/15 = 0.6000, 25/15 = 1.6667, and 25/15 = 1.6667. The total is 4.5333 with df = 4 - 1 = 3. The last two categories account for most of the discrepancy because their deviations are five rather than three counts in magnitude.
Now use a three-category model with observed counts 50, 30, 20 and expected counts 45, 35, 20. The contributions are 25/45 = 0.5556, 25/35 = 0.7143, and 0. The total is about 1.2698 with df = 2. This is a useful reminder that two nonzero deviations can be modest even when the raw counts look different. The denominator and the total sample size determine the scale of the comparison.
An observed zero is valid when the expected count is positive. For observed 0, 12, 18 and expected 5, 10, 15, the contributions are 25/5 = 5, 4/10 = 0.4, and 9/15 = 0.6. The statistic is 6 with df = 2. The zero contributes strongly because an outcome predicted to occur five times did not occur. Whether that is surprising enough for a decision still depends on the reference distribution and the planned threshold.
For a fair six-outcome experiment with 60 trials, the expected list is six values of 10. If the observed list is 18, 14, 9, 11, 8, 10, the contributions are 6.4, 1.6, 0.1, 0.1, 0.4, and 0, giving a total of 8.6 and df = 5. The first category dominates. That pattern may prompt a check of the equipment, recording, or category definition, but a contribution ranking alone does not establish a cause.
The formula requires every E_i to be positive, which is why the handler rejects an expected zero. For an inferential chi-square approximation, expected counts should also be large enough that the reference distribution is a reasonable approximation to the true sampling distribution. A common planning preference is at least 5 in every category. The 5+ guideline is not a magical boundary, but it is a useful warning signal that the ordinary approximation may be unreliable when it is violated.
Sparse expected counts cause two related problems. First, the denominator makes a small absolute discrepancy produce a large contribution. Second, the continuous chi-square reference distribution may not describe the discrete count outcomes well. A category with an expected count of 0.2 is not made safe by entering 0.2 instead of zero. It remains a sparse category with a fragile contribution and a model that needs review.
If categories are substantively similar, combining them before the analysis can increase expected counts, but the grouping rule should come from the subject matter rather than from the observed result. Combining only the categories that look inconvenient changes the question and can hide the very departure being studied. If rare categories are scientifically essential, retain them and use a method designed for sparse data instead of forcing the preferred approximation.
Exact multinomial calculations, conditional methods, or simulation-based reference distributions can be better choices for small samples. These alternatives still require a defensible null model and category mapping. A different method is not a license to ignore structural zeros, missing outcomes, or dependent observations; it only changes how sampling variability is represented.
The usual independence assumption concerns the observations that produced the counts. Each trial, person, item, or event should contribute an outcome without its category being determined by another observation in the sample. The category totals themselves must add to a fixed N and therefore are mathematically linked; calling the observations independent does not mean the final cell counts are free to vary independently.
A random or otherwise defensible sampling process is also important. If the sample is a convenience group, a single time window, a biased collection source, or a deliberately selected set of cases, a small p-value may describe that selection process rather than a general population. A representative sample is not guaranteed by a large sample size. Document who or what could enter the sample and how each outcome was assigned.
Repeated measurements from the same person, multiple items from one batch, households sampled together, sites sharing a common environment, time-series observations, and clustered survey designs can create dependence. In those settings, a flat count comparison can understate or misrepresent uncertainty. A cluster-aware, repeated-measures, hierarchical, or resampling approach may be needed, depending on the design.
Weights and adjustments require special care. A weighted total can be useful for estimation, but fractional weighted counts do not automatically have the same sampling distribution as raw multinomial counts. If exposure differs across categories, the expected model may need offsets or rate comparisons rather than simple counts. The calculator can evaluate the entered arithmetic, but it cannot recognize whether the data-generating design supports the chi-square reference distribution.
The chi-square statistic is a distance-like summary of the observed counts from the expected counts. A p-value is a tail probability calculated under the null model and a specified degrees-of-freedom reference distribution. For a goodness-of-fit statistic, the relevant tail is normally the upper tail: values at least as large as the one observed. The p-value therefore requires more than the two lists. It requires a valid null model, an appropriate df, and a method for evaluating the reference distribution.
A decision rule should be chosen before interpreting the result. With a stated significance level alpha, one common rule rejects the null when the p-value is at most alpha and otherwise reports failure to reject. Failure to reject does not prove the expected distribution is true. It means the sample did not provide enough evidence against it under the chosen model, design, and threshold. A small p-value also does not prove that the model is the only possible explanation for the data.
Statistical significance and practical importance can diverge. With a very large sample, a tiny departure from an expected ratio can generate a large statistic and a small p-value. With a small sample, a meaningful departure can remain uncertain. Report the counts, expected model, statistic, df, p-value if separately computed, decision rule, and an effect description rather than reducing the analysis to a binary label.
The chi-square distribution has no negative tail for this statistic. A category being below expectation does not create a lower-tail goodness-of-fit test; its squared contribution is already part of the two-sided discrepancy measure. If the substantive question is specifically whether one category is lower or higher, a planned directional analysis may be more suitable than changing the interpretation of the omnibus statistic.
Do not interpret a p-value as the probability that the null hypothesis is true, the probability that the observed data were caused by chance, or the size of the discrepancy. It is conditional on the null model and sampling procedure. If categories, the expected rule, or the stopping point were chosen after inspecting the data, the nominal p-value can be optimistic and should not be reported without that selection context.
The breakdown is one of the most useful outputs because it shows how the total was assembled. A contribution near zero means that the category is close to its expected count relative to its expected scale. A large contribution means that the category is influential in the omnibus discrepancy. To recover direction, inspect the signed difference O_i - E_i or the signed standardized residual (O_i - E_i) divided by the square root of E_i.
A positive residual means overrepresentation: more observations occurred than the model predicted. A negative residual means underrepresentation. In the default example, category 1 is under by five and category 2 is over by five, and both contributions are 1.6667 because their expected counts are equal. If the expected counts differed, equal raw deviations would not necessarily produce equal contributions.
You can compute each contribution's share of the total as its contribution divided by chi-square when the total is positive. That is a descriptive way to prioritize review. It is not a probability that the category is responsible for the model failure, and it is not a category-level p-value. Looking at many residuals and selecting the most extreme one creates a multiple-comparison issue that needs a planned adjustment or a separate exploratory label.
Residual review should include the raw records or a labeled summary. A high contribution may reveal a recording error, a category with unclear rules, an omitted exposure difference, or a real departure. The calculator reports numbers without labels, so attach category names and data-quality notes outside the input fields before drawing a substantive conclusion.
Use the most precise defensible values when constructing expected counts and retain unrounded values through the calculation. Rounding each expected count separately can change the total, and rounding both observed and expected values can change small differences disproportionately. The effect is especially visible when O_i and E_i are close, because the test depends on their subtraction, or when E_i is small, because the denominator magnifies the result.
The handler calculates with the entered JavaScript numeric values and displays the chi-square result to four decimal places. Contributions in the breakdown are also formatted to four decimal places, while degrees of freedom is displayed as an integer. The displayed contributions may not add exactly to the displayed total because each component was rounded for presentation after the total was calculated. Use the underlying inputs and unrounded arithmetic when a reconciliation needs more precision.
If the source data are only known to whole counts, do not report a long decimal as if it were highly accurate. If expected values are fractional because they come from probabilities, that is normal, but the probability model and total should be retained. If observed values are fractional weights, state that they are weighted values and confirm that the chosen inferential method supports them rather than assuming that parser acceptance proves validity.
The numeric bounds are broad, but broad bounds are not a recommendation. A very large observed value paired with a nearly equal expected value can lose meaningful digits in subtraction. An extremely small positive expected value can make a contribution overflow even though it passes the positivity test. If the result is too large to calculate, revisit units, scaling, category construction, and the expected model; do not replace a value silently.
The most damaging mistake is comparing the wrong pairs. If the expected order does not match the observed order, every contribution is attached to the wrong category. The next common error is using the wrong denominator or forgetting to square the difference. Write one row as (O_i - E_i)^2 divided by E_i before summing, and check that an exact match contributes zero.
Another error is treating the expected list as optional decoration. Expected counts encode the null hypothesis. Entering observed counts in both fields tests exact self-agreement and always returns zero, but it does not test a meaningful external claim. Similarly, entering percentages without converting them to expected counts can create a mismatch between a probability scale and a count scale.
Users also often use the wrong degrees of freedom, especially when they count categories rather than subtract one. Or they apply this one-variable calculation to a two-way table by flattening the table, which discards the row and column structure. A correct formula applied to the wrong design is still the wrong analysis.
Finally, avoid turning an exploratory result into a causal or operational decision. A large statistic can be caused by dependence, biased sampling, category changes, recording errors, or a reasonable but imprecise model. A small statistic can coexist with a practically important difference when the sample is small. Keep the inferential language proportional to what the data and design establish.
The ordinary chi-square approximation is attractive because it is simple, fast, and easy to audit, but it is not universal. For very small samples or sparse expected counts, an exact multinomial calculation can represent the discrete sampling space more directly. A conditional or permutation-style procedure may be useful when the design provides a natural way to generate samples under the null. A simulation-based reference distribution can also help when an exact calculation is difficult, provided the simulation preserves the relevant design.
A likelihood-ratio goodness-of-fit statistic is another large-sample alternative. It compares observed counts with expected counts using logarithmic terms rather than squared differences. It may behave differently in finite samples, especially with sparse cells, and it should not be substituted casually while retaining the same interpretation and cutoffs. For two categories, a binomial test may be more direct. For several categories with estimated parameters, a fitted multinomial or other model can make the parameter and df accounting explicit.
The calculator is limited to a single pair of flat lists. It has no category labels, no data table, no missing-value handling beyond token validation, no exposure field, no sampling weights, no parameter-fitting step, no exact reference distribution, and no p-value field. It cannot compare repeated samples, model trend across ordered categories, test association between variables, or diagnose which record caused a residual.
A method choice should follow the data-generating process. Ordered categories may call for a trend analysis. Dependent observations may call for a clustered model. Rates with unequal exposure may require a different denominator. A table with two categorical dimensions needs an independence or homogeneity framework. An exact or simulated method may be preferable when expected counts are small. The output of this calculator is still useful as a transparent descriptive statistic, but its inferential role depends on those choices.
The calculator does not decide what the categories mean or whether the categories are mutually exclusive. It does not know whether category 1 is a color, a treatment response, a defect code, or an administrative label. It cannot tell whether an observation was classified consistently, whether an unclassified outcome was omitted, or whether a category boundary changed during collection.
It does not decide whether the expected distribution is reasonable, whether its probabilities were specified before seeing the sample, or whether the expected counts should sum to the observed total. It does not determine whether parameters were estimated from the same data or reduce the degrees of freedom for that estimation. The returned df is the fixed categories - 1 rule encoded by the record.
It does not decide whether sampling was random, representative, independent, or free from clustering and repeated-measure dependence. It does not assess missingness, measurement error, selection bias, exposure differences, stopping rules, or data fabrication. These are design and data-quality questions that no two-list arithmetic can answer.
It does not calculate a p-value, choose alpha, make a reject or fail-to-reject decision, measure practical importance, establish causation, identify a responsible category, or recommend an operational response. It returns a statistic, degrees of freedom, and contribution breakdown. Those outputs become an inference only when joined to a justified model, a valid sampling design, an appropriate reference distribution, and a clearly stated decision context.
Begin with a labeled table containing the category names, observed counts, expected probabilities or counts, and the source of the expected model. Check that every observation belongs to one category, that the categories are in the same order, and that the ordinary fixed-total construction gives matching totals. Record whether any values were rounded, weighted, or estimated from the sample.
Enter the two lists without labels or expressions and read the validation result. Confirm that the list lengths match, there are at least two categories, observed values are nonnegative, and expected values are positive. Inspect the expected-count guideline before relying on an inferential approximation. If a value is rejected, correct the data preparation rather than altering the meaning of the category.
After the result appears, verify one or two contributions by hand. Sum the unrounded contributions, compare that sum with the displayed statistic, and check df = categories - 1. Then inspect signed differences and the labeled source table to see which categories are over or under expectation. If a p-value is needed, calculate it separately with the correct upper-tail reference distribution and document why that reference is justified.
A concise report can state the question, category order, observed list, expected list, total, chi-square statistic, df, p-value if computed, alpha if a decision was planned, the largest residual contributions, and the relevant assumptions. Add a plain-language conclusion that distinguishes evidence of discrepancy from evidence about cause or practical importance. Preserve the original lists so another analyst can reproduce the same arithmetic and challenge the modeling choices.
Tests counts against expected counts with the Pearson chi-square statistic.
χ² = Σ(O−E)²/E; df = categories − 1. Sums squared standardized residuals across categories. Larger values signal worse fit at df = categories − 1.
Enter Observed counts, Expected counts, then choose Calculate.
Independent counts with matching observed/expected categories. Every expected count positive (5+ preferred); at least 2 categories.
This calculator is part of the WorldCalculate library. Its formula, example, assumptions, input bounds, and output formatting follow the official methodology.
These WorldCalculate collections connect this tool with related questions while keeping each calculation separate and transparent.