R-Squared Calculator
Enter your observed and predicted (or X and Y) values to instantly calculate R², SS_res, SS_tot, and RMSE.
Data Input
Enter your data on the left and click Calculate R²
Coefficient of Determination
—
R²
0 — No fit
1 — Perfect fit
SSres (Residual)
—
Sum of squared residuals
SStot (Total)
—
Total sum of squares
RMSE
—
Root mean squared error
n (Pairs)
—
Number of data points
Residuals Table
| # | Observed | Predicted | Residual | Residual² |
|---|
Copied!
Summary
Enter your observed and predicted (or X and Y) values to instantly calculate R², SS_res, SS_tot, and RMSE.
How it works
- Enter your observed (actual) values in the left column, one per line.
- Enter your predicted (model output) values in the right column, one per line.
- Click Calculate to get R², SS_res, SS_tot, and RMSE.
- R² ranges from 0 to 1; values closer to 1 indicate a better model fit.
- Use the sample data button to see an example before entering your own numbers.
Use cases
- Evaluate how well a linear regression model fits your data.
- Compare two regression models to pick the better predictor.
- Assess forecast accuracy in finance and sales projections.
- Validate machine learning model predictions against ground truth.
- Grade the fit of a trend line drawn through a scatter plot.
- Report goodness-of-fit in academic research or data science projects.
Frequently Asked Questions
Last updated: 2026-06-09 ·
Reviewed by Nham Vu