Quick answer
R-squared is the share of variance in y explained by x: r² = Sxy² ÷ (Sxx·Syy). For x = 1 to 5 and y = 2, 4, 5, 4, 5, R² = 0.6.
Enter equal-length x and y lists. The calculator returns R².
Related tools: Least Squares Regression Calculator: Fit the least-squares regression line to paired data and read off the slope, intercept and a prediction. Correlation Coefficient Calculator: Pearson correlation of two variables. Covariance Calculator: Sample and population covariance.
How to use the R-Squared Calculator
- Type x values, for example 1, 2, 3, 4, 5.
- Type y values, for example 2, 4, 5, 4, 5.
- Press Calculate to see the result, and use Reset to start again.
| Input | What to enter | Allowed values |
|---|---|---|
| x values | Text, such as 1, 2, 3, 4, 5 | — |
| y values | Text, such as 2, 4, 5, 4, 5 | — |
Formula and method
Formula
r² = Sxy² ÷ (Sxx·Syy)
IEEE-754 double precision; shown to at most 6 decimal places.
Square of the Pearson correlation.
Worked examples
These examples are verified: each one is an automated test case that the live calculator must reproduce exactly.
Example 1
Inputs: x values = 1,2,3,4,5; y values = 2,4,5,4,5.
| Result | Value |
|---|---|
| R² | 0.6 |
Example 2
Inputs: x values = 1 2 3; y values = 2 4 6.
| Result | Value |
|---|---|
| R² | 1 |
The first line is the headline result (r²). IEEE-754 double precision; shown to at most 6 decimal places.
Reading 0.6
60% of the variation in y is explained by the linear relationship with x, and 40% is unexplained. It is the square of the correlation coefficient: 0.7746² = 0.6.
Caution
A high R² doesn't prove causation or that a line is the right model. Both variables must vary. In multiple regression R² never falls as predictors are added, so use adjusted R².
What r² means
r² = 0.6 means 60% of the variation in y is accounted for by its straight-line relationship with x. The other 40% is unexplained.
A high r² does not prove the model is right and a low one does not make it useless. What counts as good depends on the field.
What happens with invalid input
These messages are produced by the calculator itself, so you know what to fix.
- x values: entering "1,1,1" shows "x values must not all be equal." beside that field and no result.
Choosing between the R-Squared Calculator and similar calculators
Each row shows what a related calculator on this site asks for and what it returns, so you can pick the one that matches your question.
| Calculator | You enter | It returns |
|---|---|---|
| [Least Squares Regression Calculator](/statistics/least-squares-regression/) | x values and y values | Regression line |
| [Correlation Coefficient Calculator](/statistics/correlation-coefficient-calculator/) | x values and y values | Correlation r |
| [Covariance Calculator](/statistics/covariance-calculator/) | x values and y values | Sample covariance |
| [Linear Regression Calculator](/statistics/linear-regression-calculator/) | x values and y values | Regression line |
| [Multiple Linear Regression Calculator](/statistics/multiple-regression-calculator/) | response values and predictor 1 | Coefficients (intercept, b₁, b₂ …) |
Background: regression and correlation
Least squares chooses the line that minimises the sum of the squared vertical distances from the points. The slope is the sum of the cross-products of the deviations divided by the sum of the squared x deviations, and the intercept is the mean of y minus the slope times the mean of x.
For simple regression R² is the square of the correlation coefficient r, the share of the variation in y that the line explains. R² has no sign, so the sign of the slope tells you whether the relationship rises or falls. A strong fit does not prove one variable causes the other.
Assumptions and limitations
- Both variables must vary
If a required value is empty, not a number, or outside its allowed range, the form marks that field with a message and shows no result instead of a misleading number. The automated checks deliberately try invalid entries for x values to confirm this.
Frequently asked questions
What is a good R²?
It depends on the field.
What does R² = 1 mean?
All points on the line.
Can R² be negative?
Not for simple linear regression.
What is a good r² value?
It depends on the field. Physical experiments often show values near 1, while human behaviour data may be much lower.
Can r² be negative?
For the squared correlation of two variables it ranges from 0 to 1.
What does the R-Squared Calculator calculate?
Coefficient of determination for a simple linear fit. It returns R².
What formula does the R-Squared Calculator use?
r² = Sxy² ÷ (Sxx·Syy). Square of the Pearson correlation.
What do I need to enter in the r-Squared Calculator?
You enter x values and y values.
How is the result rounded or limited?
IEEE-754 double precision; shown to at most 6 decimal places. Both variables must vary.
What is an example of a r-Squared result?
With x values 1,2,3,4,5 and y values 2,4,5,4,5, the r² is 0.6.
Related calculators
- Least Squares Regression Calculator — Fit the least-squares regression line to paired data and read off the slope, intercept and a prediction.
- Correlation Coefficient Calculator — Pearson correlation of two variables.
- Covariance Calculator — Sample and population covariance.
- Linear Regression Calculator — Least-squares line y = a + bx through paired data.
- Multiple Linear Regression Calculator — Least-squares coefficients and R² for up to three predictors.
- Standard Deviation Calculator — Sample or population standard deviation with variance and mean.
Sources
- OpenStax, Introductory Statistics 2e (Rice University): measures of center and spread, correlation and regression
- NIST/SEMATECH e-Handbook of Statistical Methods (nist.gov), Exploratory Data Analysis chapter
Content last reviewed 2026-11-04. Formulas and worked examples are checked by automated tests against independently computed values.