Math calculators

Correlation Coefficient Calculator

Updated Sep 28, 2026 By Infinity Calculator
X
At least 3 paired values required
Y
Must have same count as Variable X


Correlation Results

Correlation Coefficient (r)

0.9408

Strong Positive

R² (Coefficient of Determination)

0.8851

88.51% of variance explained

p-value

0.0174

Significant

Test Statistic

t = 4.8074

df = 3

Sample Size (n)

5

95% Confidence Interval

[0.2714, 0.9953]

Effect Size (Cohen)

Large

Standard Error

0.1957

Scatter Plot with Regression Line
Paired Data & Calculations
i X Y X - X̄ Y - Ȳ (X-X̄)(Y-Ȳ) (X-X̄)² (Y-Ȳ)²
Step-by-Step Calculation
Interpretation


Introduction

The correlation coefficient is a number between -1 and 1 that tells you how strongly two sets of data are related.1 A value close to 1 means the data points move together in the same direction. A value close to -1 means they move in opposite directions. A value near 0 means there is little or no straight-line connection between them.1 This measure, often called "r," is one of the most useful tools in statistics for finding patterns in data.

Use this correlation coefficient calculator to quickly find the relationship between two variables. Just enter your data sets, and the calculator works out the correlation coefficient. This tool saves you time and helps you avoid mistakes that can happen when solving by hand.

How to Use Our Correlation Coefficient Calculator

Enter your data for two variables, and this calculator will find the correlation coefficient, R² value, p-value, confidence interval, and a step-by-step breakdown of the calculation. It also shows a scatter plot with a regression line to help you see the relationship between your variables.

Correlation Method: Choose the type of correlation you want to calculate. Pick Pearson if your data is numerical and has a straight-line relationship. Pick Spearman's Rank if your data is ranked or does not follow a straight line. Pearson is selected by default.

Variable X Data: Type or paste the values for your first variable into this box. Separate each number with a comma, space, or new line. You can click the label next to "Variable" to rename it (for example, "Hours Studied"). You need at least 3 values.

Variable Y Data: Type or paste the values for your second variable into this box, using the same format as Variable X. The number of values here must match the number of values in Variable X, since each X value pairs with a Y value.

Load Example Data: Click this button to fill in a sample dataset of 10 paired values for "Hours Studied" and "Exam Score." This is a quick way to see how the calculator works before entering your own data.

Advanced Options – Significance Level (α): This sets the threshold for deciding if your result is statistically significant. Common choices are 0.01, 0.05, and 0.10. You can also type in a custom value. The default is 0.05, which means a 5% chance of a false positive.

Advanced Options – Expected Correlation (ρ₀): This is the value you are testing against in your null hypothesis. The default is 0, which tests whether there is any correlation at all. Change this if you want to test whether the correlation differs from a specific number.

Advanced Options – Tail Selection: Choose Two-tailed to test if the correlation is simply different from ρ₀ in either direction. Choose Left-tailed to test if the correlation is less than ρ₀, or Right-tailed to test if it is greater than ρ₀.

Advanced Options – Distribution: Select how the p-value is calculated. Automatic picks the best method for your data. T-distribution is the standard approach for small samples. Fisher transformation (Z) is used when testing against a non-zero ρ₀ or with larger samples.

Advanced Options – Effect Size Preset: This is a reference tool that lets you compare your result to standard benchmarks. Small is 0.1, Medium is 0.3, and Large is 0.5. It does not change your calculation. It simply helps you understand how strong your correlation is.

Calculate Correlation: Once you have entered your data and chosen your settings, click this button. The calculator will display the correlation coefficient, R², p-value, test statistic, confidence interval, effect size, a paired data table, a scatter plot, and a full step-by-step solution with an interpretation of the results.

What Is the Correlation Coefficient?

The correlation coefficient is a number between -1 and +1 that tells you how strongly two variables are related and in what direction.1 For example, you might want to know if more hours of studying leads to higher test scores, or if temperature affects ice cream sales. The correlation coefficient gives you a single number that summarizes that relationship.

  • A value of +1 means a perfect positive relationship: as one variable goes up, the other always goes up by a proportional amount.1
  • A value of -1 means a perfect negative relationship: as one variable goes up, the other always goes down.1
  • A value of 0 means there is no linear relationship at all.1

Pearson vs. Spearman Correlation

There are two main types of correlation this calculator can compute. Pearson's correlation coefficient (often written as r) measures the strength of the linear relationship between two variables.3 It works best when your data follows a straight-line pattern and both variables are measured on a continuous scale, like height and weight.

Spearman's rank correlation coefficient (often written as rₛ) measures the strength of a monotonic relationship. Instead of using the raw data values, it first converts them to ranks and then calculates the correlation on those ranks.5 This makes it useful when your data can only be ranked, is not normally distributed, or when the relationship is consistent in direction but not strictly a straight line.5 It is also less affected by outliers.

Key Output Values Explained

The R² value (coefficient of determination) is simply the correlation coefficient squared.1 It tells you the percentage of change in one variable that can be explained by the other variable.1 For instance, an R² of 0.85 means 85% of the variation in Y is explained by X.

The p-value is the probability of getting a correlation at least as far from ρ₀ as yours if the true correlation really were ρ₀ (0 by default).6 A small p-value (typically less than 0.05) means your data would be unusual under that assumption, and the result is called statistically significant.6

The confidence interval gives a range where the true population correlation likely falls. A 95% confidence interval means that if you repeated the study many times, about 95% of those intervals would contain the true correlation value.7

How to Interpret the Strength of a Correlation

The Effect Size result uses Cohen's guidelines for correlations:

  • |r| < 0.1: Very small
  • |r| = 0.1 to 0.3: Small
  • |r| = 0.3 to 0.5: Medium
  • |r| ≥ 0.5: Large

The strength label shown next to r uses wider bands: an |r| of 0.7 or more is strong, 0.3 to 0.7 is moderate, 0.1 to 0.3 is weak, and below 0.1 is negligible.

Important Things to Remember

Correlation does not mean causation. Just because two variables move together does not mean one causes the other.1 A strong correlation between ice cream sales and drowning incidents does not mean ice cream causes drowning. Both are caused by hot weather.

You need at least 3 paired data points to calculate a correlation, but more data gives you more reliable results. With very small samples, even a high correlation may not be statistically significant because there is too much uncertainty. Both variables must have the same number of values, and each pair should represent a matched observation, such as the same person's height and weight.

Before calculating correlation, it can be helpful to understand the basic characteristics of your data. The standard deviation describes the spread of each variable, while the interquartile range helps you identify outliers that could skew your results.


Formulas used

Pearson Correlation Coefficient 3
r = \frac{\sum_{i=1}^{n}(X_i - \bar{X})(Y_i - \bar{Y})}{\sqrt{\sum_{i=1}^{n}(X_i - \bar{X})^2 \cdot \sum_{i=1}^{n}(Y_i - \bar{Y})^2}}
Spearman's Rank Correlation Coefficient 5
r_s = \frac{\sum_{i=1}^{n}(R_{x,i} - \bar{R}_x)(R_{y,i} - \bar{R}_y)}{\sqrt{\sum_{i=1}^{n}(R_{x,i} - \bar{R}_x)^2 \cdot \sum_{i=1}^{n}(R_{y,i} - \bar{R}_y)^2}}
Coefficient of Determination 1
R^2 = r^2
t-Test Statistic 2
t = \frac{r\sqrt{n-2}}{\sqrt{1-r^2}}, \quad df = n - 2
Fisher z-Transformation 4
z = \frac{1}{2} \ln\!\left(\frac{1+r}{1-r}\right), \quad SE = \frac{1}{\sqrt{n-3}}
Confidence Interval for ρ (Fisher Method)
CI = \left[\tanh\!\left(z_r - z_{\alpha/2}\cdot\frac{1}{\sqrt{n-3}}\right),\; \tanh\!\left(z_r + z_{\alpha/2}\cdot\frac{1}{\sqrt{n-3}}\right)\right]
Standard Error of r
SE_r = \sqrt{\frac{1 - r^2}{n - 2}}

Frequently asked questions

What is a good correlation coefficient value?

It depends on your field and purpose. The strength label in this calculator calls an r of 0.7 or higher (or -0.7 or lower) strong, 0.3 to 0.7 moderate, 0.1 to 0.3 weak, and below 0.1 negligible. Cohen's guidelines, shown as the effect size, use lower cut-offs: 0.1 small, 0.3 medium and 0.5 large. A significant p-value does not by itself make a correlation large or important.6

Can the correlation coefficient be negative?

Yes. A negative correlation coefficient means that as one variable goes up, the other tends to go down. For example, the more hours you spend watching TV, the lower your test scores might be. A value of -1 is a perfect negative correlation.1 A value of -0.5 would be a moderate negative correlation.

How many data points do I need to get a reliable result?

The calculator requires at least 3 paired values, but that is the bare minimum. For more reliable and meaningful results, you should use at least 20 to 30 data points. Small samples can produce high correlation values that are not statistically significant.

What is the difference between r and R²?

r is the correlation coefficient that shows the direction and strength of a relationship. R² is r squared, and it tells you the percentage of variance in one variable that is explained by the other.1 For example, if r = 0.8, then R² = 0.64, meaning 64% of the change in Y is explained by X.

When should I use Spearman instead of Pearson?

Use Spearman's rank correlation when your data is not normally distributed, uses ranked or ordinal data, or when the relationship is curved but still consistently goes in one direction.5 It is also less affected by outliers. Use Pearson when both variables are continuous numbers and the relationship looks like a straight line.

What does the confidence interval for correlation mean?

The confidence interval gives a range of values where the true population correlation likely falls.7 For example, a 95% confidence interval of [0.27, 0.99] means you can be 95% confident the true correlation is somewhere between 0.27 and 0.99. Wider intervals mean more uncertainty, usually due to smaller samples.

What does it mean if my correlation is 0?

A correlation of 0 means there is no linear relationship between the two variables.1 The data points are scattered randomly with no clear pattern. However, there could still be a non-linear relationship (like a curve) that the correlation coefficient does not detect.1

What is the Fisher z-transformation used for?

The Fisher z-transformation converts the correlation coefficient into a value that approximately follows a normal distribution.4 This is used to calculate confidence intervals and to test hypotheses when the expected correlation is not zero or when you have a larger sample. The calculator applies it automatically when needed.

Why do my X and Y data need the same number of values?

Correlation works by comparing paired observations. Each X value is matched with a Y value from the same person, time point, or object. If the counts do not match, the calculator cannot pair them properly, so it will show an error message.

What is a two-tailed vs. one-tailed test?

A two-tailed test checks if the correlation is different from the expected value in either direction (positive or negative). A one-tailed test checks only one direction: either greater than or less than the expected value. Use two-tailed when you do not have a specific prediction about the direction.

Does a strong correlation prove that one variable causes the other?

No. Correlation does not prove causation.1 A strong correlation only shows that two variables move together. The relationship could be caused by a third factor, or it could be a coincidence. You need a controlled experiment to prove cause and effect.


Sources

  1. Illowsky B, Dean S. Introductory Statistics 2e, 12.3 The Regression Equation. OpenStax. 2023;§ 12.3. Accessed September 28, 2026.
  2. Illowsky B, Dean S. Introductory Statistics 2e, 12.4 Testing the Significance of the Correlation Coefficient. OpenStax. 2023;§ 12.4. Accessed September 28, 2026.
  3. Dataplot Reference Manual: CORRELATION. National Institute of Standards and Technology. 2018. Accessed September 28, 2026.
  4. Dataplot Reference Manual: CORRELATION CONFIDENCE LIMITS. National Institute of Standards and Technology. 2023. Accessed September 28, 2026.
  5. DATAPLOT Reference Manual: RANK CORRELATION. National Institute of Standards and Technology. 1997;p. 2-43. Accessed September 28, 2026.
  6. Wasserstein RL, Lazar NA. The ASA Statement on p-Values: Context, Process, and Purpose. The American Statistician. 2016;70(2):129-133. doi:10.1080/00031305.2016.1154108. Accessed September 28, 2026.
  7. NIST/SEMATECH e-Handbook of Statistical Methods, 7.1.4 What are confidence intervals? National Institute of Standards and Technology. § 7.1.4. Accessed September 28, 2026.