Chi-Square (χ²) Fit Calculator

Evaluate goodness-of-fit between measured data and theoretical model predictions

Parameters

ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
ⓘ
Show Trail

Controls

xⓘ

Calculated Values

χ²:
2.76;2.76;
Degrees of freedom ν:
3.00;3.00;
Reduced χ²:
0.92;0.92;
Fit quality:
1.00;Acceptable1.00;Acceptable

Examples

Linear model check

Four points with σᵢ ≈ 1; Eᵢ from best-fit line.

  • χ²: 2.762.76
  • χ²_red: 0.920.92

Ideal gas at four temperatures

Compare measured P to PV=nRT prediction.

  • Accept if χ²_red ≈ 1: 1.001.00

Visualization

Chi-Square Goodness of Fit

The chi-square statistic measures how well experimental data agree with a theoretical model, weighted by measurement uncertainty. Large χ² means residuals (O − E) are large compared to your stated errors.

For n data points and p fitted parameters, χ² = Σᵢ (Oᵢ − Eᵢ)² / σᵢ². Each term is dimensionless because the residual is divided by the expected standard deviation σᵢ.

Degrees of freedom ν = n − p. For a simple consistency check with no fitted parameters (p = 0), use ν = n − 1. Reduced chi-square χ²_red = χ² / ν should be near 1 if the model and uncertainties are correct.

Rule of thumb: 0.5 ≲ χ²_red ≲ 1.5 suggests acceptable agreement. χ²_red ≫ 2 often means underestimated σᵢ, wrong model Eᵢ, or systematic errors. χ²_red ≪ 1 may mean overestimated uncertainties.

Always use σᵢ from Error Propagation or instrument specs — not the spread of repeated trials unless those trials are independent measurements of the same quantity.

χ² is widely used in particle physics, astronomy, and any lab comparing a curve (Hooke’s law, ideal gas, radioactive decay) to measured points.

Key Concepts

  • χ² = Σ (O − E)² / σ²
  • ν = n − p (degrees of freedom)
  • χ²_red = χ² / ν ≈ 1 for good fit
  • Each point contributes (O−E)²/σ² to the total
  • Underestimated σ inflates χ²_red artificially

Real-World Applications

  • Verifying linear fit (F = kx) through spring data
  • Checking ideal gas law at multiple temperatures
  • Comparing measured decay rates to exponential model
  • Assessing whether outliers dominate a dataset

Explore Further

More measurement uncertainty tools

  • Error Propagation

    Combine measurement uncertainties for sums, products, quotients, and powers in experimental formulas.

  • Significant Figures

    Round measurements and calculated results to the correct precision for lab reports.

Physics Equations

Chi-square:
χ2=∑i(Oi−Ei)2σi2\chi^2 = \sum_i \frac{(O_i - E_i)^2}{\sigma_i^2}
Reduced:
χred2=χ2ν,ν=n−p\chi^2_{\text{red}} = \frac{\chi^2}{\nu}, \quad \nu = n - p
Per-point term:
χi2=(Oi−Ei)2σi2\chi^2_i = \frac{(O_i - E_i)^2}{\sigma_i^2}

Step-by-Step Solution

See how the main results are calculated.

1

Step 1: Organize data table

For each point: observed Oᵢ, model prediction Eᵢ, uncertainty σᵢ.

Result:

4datapoints,3degreesoffreedom(ν=n−1)4 data points, 3 degrees of freedom (ν = n − 1)

Explanation:

σᵢ should come from measurement error or propagated uncertainty, not arbitrary guesses.

2

Step 2: Point 1 contribution

Compute squared residual weighted by uncertainty.

Equation:

χi2=(Oi−Ei)2σi2\chi^2_i = \frac{(O_i - E_i)^2}{\sigma_i^2}

Calculation:

(10−9.5)212=0.25001.0000=0.2500\frac{(10 - 9.5)^2}{1^2} = \frac{0.2500}{1.0000} = 0.2500

Result:

χ12=0.2500\chi^2_1 = 0.2500

Explanation:

Residual = 0.500; a 1 error bar means this point agrees well with the model.

3

Step 3: Point 2 contribution

Compute squared residual weighted by uncertainty.

Equation:

χi2=(Oi−Ei)2σi2\chi^2_i = \frac{(O_i - E_i)^2}{\sigma_i^2}

Calculation:

(15−14)21.22=1.00001.4400=0.6944\frac{(15 - 14)^2}{1.2^2} = \frac{1.0000}{1.4400} = 0.6944

Result:

χ22=0.6944\chi^2_2 = 0.6944

Explanation:

Residual = 1.000; a 1.2 error bar means this point agrees well with the model.

4

Step 4: Point 3 contribution

Compute squared residual weighted by uncertainty.

Equation:

χi2=(Oi−Ei)2σi2\chi^2_i = \frac{(O_i - E_i)^2}{\sigma_i^2}

Calculation:

(8−9)20.82=1.00000.6400=1.5625\frac{(8 - 9)^2}{0.8^2} = \frac{1.0000}{0.6400} = 1.5625

Result:

χ32=1.5625\chi^2_3 = 1.5625

Explanation:

Residual = -1.000; a 0.8 error bar means this point is acceptable with the model.

5

Step 5: Point 4 contribution

Compute squared residual weighted by uncertainty.

Equation:

χi2=(Oi−Ei)2σi2\chi^2_i = \frac{(O_i - E_i)^2}{\sigma_i^2}

Calculation:

(12−11.5)212=0.25001.0000=0.2500\frac{(12 - 11.5)^2}{1^2} = \frac{0.2500}{1.0000} = 0.2500

Result:

χ42=0.2500\chi^2_4 = 0.2500

Explanation:

Residual = 0.500; a 1 error bar means this point agrees well with the model.

6

Step 6: Sum all contributions

Add individual χ²ᵢ terms for total χ².

Equation:

χ2=∑iχi2\chi^2 = \sum_i \chi^2_i

Calculation:

0.2500+0.6944+1.5625+0.2500=2.75690.2500 + 0.6944 + 1.5625 + 0.2500 = 2.7569

Result:

χ2=2.7569\chi^2 = 2.7569
7

Step 7: Compute reduced chi-square

Normalize by degrees of freedom to assess overall fit quality.

Equation:

χred2=χ2ν\chi^2_{\text{red}} = \frac{\chi^2}{\nu}

Calculation:

2.75693=0.9190\frac{2.7569}{3} = 0.9190

Result:

χred2=0.9190\chi^2_{\text{red}} = 0.9190

Explanation:

χ²_red below 0.5 may mean overestimated σ; 0.5–1.5 is good; above 2 suggests model or σ issues.

8

Step 8: Interpret the fit

Compare χ²_red to unity.

Result:

Acceptable agreement between data and model within stated errors

Frequently Asked Questions (FAQ)

What if reduced χ² is very large?

Likely causes: underestimated σᵢ, wrong model Eᵢ, or systematic errors not included in σ.

Can χ²_red be less than 1?

Yes — often indicates conservative (too large) uncertainty estimates or too few data points.

Should I use σ = instrument resolution or standard deviation of trials?

Use the standard error of the mean √(s²/n) for n independent trials of the same point; use instrument resolution for single readings.

Practice MCQs

  1. Reduced χ² near 1 generally means:
  2. If all residuals are zero, χ² equals:
  3. Halving every σᵢ while keeping O and E fixed will:
  4. With n = 5 points and p = 2 fitted parameters, ν =
  5. A point with |O−E| = 2σ contributes approximately: