Correlation Coefficient Calculator

Measure how strongly two variables move together with Pearson's r and Spearman's ρ, plus r², significance, a confidence interval and a scatter plot.

Separate with commas, spaces or new lines.
Headline coefficient
Pearson r
0.875195
r² (shared variance)
0.76676.6% of the variation in y
p-value for r (two-tailed)
0.000911
95% CI for r (Fisher z)
0.547 to 0.9702
Spearman ρ
0.853674
p-value for ρ (t approx.)
0.001675
Pairs (n)
10
Pearson correlation (r)0.8752very strong positive relationship
  • Correlation measures association, not cause and effect.

Show the work

  1. Means: x̄ = 4.4, ȳ = 74.6 (n = 10 pairs)
  2. Sums of squares and cross-products: Sxx = Σ(x − x̄)² = 44.4, Syy = Σ(y − ȳ)² = 758.4, Sxy = Σ(x − x̄)(y − ȳ) = 160.6
  3. Pearson r = Sxy ÷ √(Sxx × Syy) = 160.6 ÷ √(44.4 × 758.4) = 0.875195
  4. Significance: t = r√((n − 2) ÷ (1 − r²)) = 5.1169 with 8 df → two-tailed p = 0.000911
  5. Spearman ρ: rank each variable (ties get the average rank), then take Pearson r of the ranks = 0.853674
607080901000246810xy(2, 68)(3, 64)(5, 75)(1, 62)(4, 80)(6, 79)(7, 90)(3, 72)(8, 86)(5, 70)
Working table
#xyx − x̄y − ȳ(x − x̄)(y − ȳ)rank xrank y
1268−2.4−6.615.8423
2364−1.4−10.614.843.52
35750.60.40.246.56
4162−3.4−12.642.8411
5480−0.45.4−2.1658
66791.64.47.0487
77902.615.440.04910
8372−1.4−2.63.643.55
98863.611.441.04109
105700.6−4.6−2.766.54
Σ4474600160.6

A correlation coefficient condenses a scatter plot into one number between −1 and +1: its sign gives the direction and its size the strength of the association. This calculator computes both of the coefficients you are likely to need, Pearson’s r for straight-line relationships and Spearman’s ρ for rank-based, monotonic ones, along with r², a significance test, a confidence interval for r and a scatter plot of your data.

How to use the correlation calculator

  1. Paste the X values in the first box and the matching Y values, in the same order, in the second.
  2. Choose which coefficient to show as the headline; both are always reported.
  3. Read r, r² and the p-value on the tape, check the scatter plot for curves or outliers, and use the working table to follow the arithmetic.

Correlation formulas

Pearson’s r divides the cross-product of deviations by the product of their spreads:

r = Σ(x − x̄)(y − ȳ) ÷ √[Σ(x − x̄)² × Σ(y − ȳ)²]

Spearman’s ρ is Pearson’s r applied to the ranks of the data. With no tied values it simplifies to

ρ = 1 − 6Σd² ÷ (n(n² − 1))

where d is the difference between each pair’s ranks. Tied values get the average of the ranks they span. To test whether a coefficient differs from zero, the calculator uses

t = r√((n − 2) ÷ (1 − r²)),   df = n − 2

and the 95% interval for r comes from Fisher’s transformation z = artanh(r), whose standard error is 1 ÷ √(n − 3).

Worked example

Ten students report hours studied and their exam scores:

Hours (x) 2 3 5 1 4 6 7 3 8 5
Score (y) 68 64 75 62 80 79 90 72 86 70
  1. Means: x̄ = 4.4 hours and ȳ = 74.6 points.
  2. Sums: Sxx = 44.4, Syy = 758.4 and Sxy = 160.6.
  3. r = 160.6 ÷ √(44.4 × 758.4) = 0.8752, a very strong positive relationship.
  4. r² = 0.766: about 77% of the variation in scores lines up with study time.
  5. t = 0.8752 × √(8 ÷ (1 − 0.766)) = 5.117 with 8 df, so p = 0.0009.
  6. The 95% confidence interval for the population correlation is 0.547 to 0.970, wide because there are only ten students.
  7. Spearman’s ρ = 0.854, close to r, which suggests the relationship is roughly linear without outliers driving it.

Interpreting correlation

Size versus significance

The p-value answers “could r be zero?”, not “is r large?” With 1,000 pairs, r = 0.07 is statistically significant yet explains under 1% of the variation. With 6 pairs, r = 0.75 may not reach significance. Report r with its confidence interval so readers see both strength and uncertainty.

Outliers and restricted ranges

A single extreme point can create or destroy a Pearson correlation; Spearman is far less sensitive. Restricting the range also weakens correlations: SAT scores correlate less with college grades among admitted students than among all applicants, because the low scorers are missing.

Pearson and Spearman disagreeing

When ρ is much larger than r, the relationship is probably monotonic but curved. When r is much larger than ρ, look for a few points far from the rest. The calculator flags a gap larger than 0.2.

For the equation of the best-fit line, use the linear regression calculator. For the unstandardized measure of joint variability that r is built on, see the covariance calculator.

Frequently asked questions

What is a good correlation coefficient?

It depends on the field. In physics or engineering, anything below 0.95 may signal a problem; in psychology or economics, 0.3 can be meaningful. A rough general scale is 0.2 weak, 0.4 moderate, 0.6 strong and 0.8 very strong, applied to the absolute value.

When should I use Spearman instead of Pearson?

Use Spearman when the data are ranks or ordinal scores, when the relationship is monotonic but curved, or when outliers would dominate Pearson's r. Spearman works on ranks, so it only asks whether y tends to rise as x rises, not whether the rise is a straight line.

What does r² mean?

r² is the share of the variation in y that a straight-line fit on x accounts for. With r = 0.875, r² = 0.766, so about 77% of the spread in y lines up with x and 23% does not. It is the same R² that a simple linear regression reports.

Does a significant correlation prove causation?

No. A third variable may drive both, the direction may run the other way, or the link may be coincidence. Ice cream sales and drowning deaths correlate because both rise in hot weather. Causal claims need a controlled experiment or careful causal analysis.

Can the correlation be zero when the variables are related?

Yes. Pearson's r measures only straight-line association. Points that form a U shape or a circle can have r near zero despite a strong relationship. Always look at the scatter plot before trusting a single number.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.