ratio.

Find a tool

Browse all tools and categories ↗
CATEGORICAL STATISTICS

Chi-square Goodness-of-fit Calculator

Compare observed category counts with entered expected weights and calculate chi-square contributions, residual degrees of freedom and an approximate upper-tail p-value.

Enter your values

01 / INPUT
Calculated on your device

YOUR CALCULATION

Result

—

Calculation steps

Work through one step at a time or reveal the complete calculation. The steps use your current inputs.

    How to calculate

    Scale expected weights to the observed total, sum squared residuals over expected counts and use a chi-square upper tail with entered fitted-parameter adjustment.

    χ²=Σ(O−E)²/E; df=categories−1−fitted parameters

    Worked example

    Observed 20, 30 and 50 against equal expected weights give expected counts of 100/3 and chi-square statistic 14. With no fitted parameters, df is 2 and upper-tail p is exp(−7).

    Assumptions and input details

    2–50 mutually exclusive categories with whole observed counts and strictly positive expected weights. Weights are normalized, so they can be ratios, probabilities or expected relative counts. You must correctly count parameters estimated from these data. Expected cells below five are flagged; dependence, sparse bins and post-selected categories may invalidate the chi-square approximation.

    References: NIST: chi-square goodness-of-fit assumptions and degrees of freedom

    Using this calculator

    Can I enter my own problem?

    Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.

    Are the results exact?

    Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.

    Is my input uploaded?

    The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.

    RELATED TOOL · STATISTICSChi-Square Independence Test Calculator

    Compute Pearson chi-square, expected counts, an approximate p-value and Cramer’s V for a contingency table.

    RELATED TOOL · CATEGORICAL STATISTICSFisher Exact Test Calculator

    Calculate conditional two-sided probability-ordering and one-sided Fisher exact p-values for a 2×2 count table.

    RELATED TOOL · MATHEMATICSStatistics Calculator

    Enter a list of numbers to calculate mean, median, modes, quartiles, population and sample standard deviation, with a frequency histogram.

    ADVERTISEMENT

    Reserved advertising space.