R-Squared (R²) Calculator — Coefficient of Determination

Enter your X and Y data points to instantly calculate R², Pearson's r, the regression line equation, and a full goodness-of-fit interpretation — free, no sign-up required.

⚡ Instant📐 R² + Pearson r📈 Scatter Plot🔢 Regression Line✦ 100% Free

R-Squared (R²) Calculator — Enter Your Data

Try sample:
One number per line, or separated by commas/spaces.
Must have the same number of values as X.
R² — Coefficient of Determination
R² = 0 (no fit)R² = 1 (perfect fit)
Weak
0–0.25
Low
0.25–0.5
Moderate
0.5–0.75
Strong
0.75–0.9
Very Strong
0.9–1
Pearson r
n (data points)
Slope (m)
Intercept (b)
SSres
SStot
#XYŶ (predicted)Residual (Y−Ŷ)(Y−Ŷ)²
📐

R² Formulas & How It's Calculated

Coefficient of Determination
R² = 1 − (SSres / SStot)
SSres = Σ(yᵢ − ŷᵢ)² · residual sum of squares
SStot = Σ(yᵢ − ȳ)² · total sum of squares
Pearson Correlation Coefficient (r)
r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √[Σ(xᵢ−x̄)² · Σ(yᵢ−ȳ)²]
R² = r² for simple linear regression. r ranges from −1 to +1.
Regression Line (Least Squares)
ŷ = mx + b
m = Σ(xᵢ−x̄)(yᵢ−ȳ) / Σ(xᵢ−x̄)²
b = ȳ − m·x̄

Step-by-Step Calculation

  • Compute the mean of X (x̄) and mean of Y (ȳ)
  • Calculate the slope m and intercept b of the best-fit line
  • For each point, compute the predicted value ŷᵢ = m·xᵢ + b
  • Sum the squared residuals: SSres = Σ(yᵢ − ŷᵢ)²
  • Sum the total variance: SStot = Σ(yᵢ − ȳ)²
  • R² = 1 − SSres/SStot
📖

How to Interpret R²

R² RangeInterpretationTypical Use
0.00 – 0.25Very weak / no relationshipExploratory research, noisy data
0.25 – 0.50Weak relationshipSocial sciences, behavioral studies
0.50 – 0.75Moderate relationshipEconomics, marketing models
0.75 – 0.90Strong relationshipEngineering, physical sciences
0.90 – 1.00Very strong / excellent fitControlled experiments, calibration
1.00Perfect fitMathematical identities only

What R² Actually Tells You

R² tells you whatproportion of the variance in Y is explained by X. An R² of 0.82 means 82% of the variability in Y can be accounted for by the linear relationship with X — and 18% is due to other factors or random noise.

R² Doesn't Mean Causation

A high R² only tells you the linear model fits well. It does not imply Xcauseschanges in Y. Two unrelated variables can have a high R² purely by coincidence (spurious correlation).

When a High R² Can Mislead

  • Overfitting— adding more variables to a model always increases R², even random noise. Use Adjusted R² for multiple regression.
  • Non-linear data— if your relationship is curved, a linear R² will be misleadingly low. Always check the scatter plot.
  • Outliers— a single extreme point can dramatically inflate or deflate R².

R² vs Adjusted R²

Adjusted R² penalizes models with unnecessary predictors. For simple linear regression (one X, one Y) R² and adjusted R² are effectively the same. Adjusted R² matters when comparing models with different numbers of variables.

R-Squared FAQ

It depends entirely on the field. In physics or engineering, R² below 0.99 may be unacceptably low. In social sciences or economics, R² of 0.5–0.7 is often considered strong. There is no universal threshold — always compare R² to benchmarks in your specific domain.
Pearson's r (correlation coefficient) measures thedirection and strengthof the linear relationship on a scale of −1 to +1. R-squared is simply r², so it's always between 0 and 1 and measures theproportion of variance explained. A correlation of r = 0.9 means R² = 0.81, so 81% of Y's variance is explained by X.
For simple linear regression calculated with least squares, R² is always between 0 and 1. However, in some contexts (non-linear models, constrained regression, or cross-validation on new data), R² can be negative — meaning the model predicts worse than simply using the mean. This calculator uses standard linear least squares, so results will always be 0–1.
R² = 0 means the linear model explains none of the variance in Y — knowing X gives you no better prediction than just guessing the mean of Y every time. This could mean no linear relationship exists, though a non-linear relationship might still be present.
You need at least 3 data points (with 2 points, R² is always exactly 1.0, which is meaningless). For statistically reliable results, 10+ data points are recommended. With fewer than 20 points, treat R² as directional rather than definitive, and consider whether the sample is representative.
SSres (residual sum of squares) is the total squared error between your actual Y values and the regression line's predicted values. SStot (total sum of squares) is the total squared deviation of Y values from their mean. R² = 1 − SSres/SStot: the closer SSres is to zero relative to SStot, the better the fit.

📚 Related Articles

Statistics guides, regression tutorials, and data analysis resources from our blog.