Skip to content
CalculatorZilo Logo
  • Home
  • CalculatorsExpand
    • Finance
    • Math
    • Health & Fitness
    • Education
    • Science
    • Real Estate
    • Chemistry
  • About Us
  • Contact Us
CalculatorZilo Logo
Home / Statistics Calculators / Correlation Coefficient Calculator 
Statistics Calculators

Correlation Coefficient Calculator 

Published onJune 5, 2026 Updated onOctober 21, 2026 12:05 am

Paste two columns of numbers into a spreadsheet and you can see they move together, but your eye cannot tell you how strongly, whether the pattern could be luck, or what line best fits it. That is the gap between looking at data and being able to say something defensible about it.

This calculator takes paired X and Y values and returns Pearson’s correlation coefficient r with its strength reading, r-squared, both means and standard deviations, the least-squares regression line, and a proper significance test with a t-statistic and two-tailed p-value.

Correlation Coefficient Calculator
Pearson’s r, r-squared, regression line, and a significance test from paired data

Results

Pearson’s r measures linear association only. It can miss a strong curved relationship completely, and correlation alone never proves causation.

Quick Answer

Quick answer: For X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 6, Pearson’s r is 0.8528, a strong positive correlation, with r-squared 0.7273 (72.7% of Y’s variation explained) and a regression line of y = 1.8000 + 0.8000x. With only 5 pairs the significance test gives t = 2.828 on 3 degrees of freedom and p = 0.0663, so the result is strong but not statistically significant at the 5% level.

Key takeaways

  • R measures linear association only, on a fixed scale from -1 to +1. The sign gives direction; the size gives strength.
  • R-squared converts r into a percentage of variance explained, which is usually the more honest number to quote.
  • A strong r from a tiny sample can still be luck. The p-value in the result is what separates a pattern from a coincidence.
  • If X or Y never varies, r is undefined, and this calculator says so instead of inventing a number.
On this page
  • Quick Answer
  • How to use the correlation coefficient calculator
  • The Pearson formula, step by step
  • Worked example, checked against this exact tool
  • What r and r-squared tell you, and what they hide
  • The significance test: why n is half the story
  • What competing calculators miss
  • Frequently Asked Questions
  • Add This Calculator to Your Website
  • References

How to use the correlation coefficient calculator

Paste your X values into the first box and your Y values into the second, comma-separated, keeping the pairing intact: the first X goes with the first Y, the second with the second, and so on. Order inside each list is the pairing, so never sort one list on its own. The boxes are pre-filled with the worked example, and the Load sample data button restores it if you clear them.

Press Calculate and read the result in order: r and its strength band first, then r-squared, then the significance line at the bottom. If the tool reports that r is undefined, one of your lists is constant, and no correlation exists to compute. If your next step is judging how precise an estimate like this is at larger samples, the confidence interval calculator covers the interval side of the same statistical thinking.

The Pearson formula, step by step

Pearson’s r compares how the two variables vary together against how much each varies on its own.

The formulas: r = [n∑xy – ∑x∑y] / √{[n∑x² – (∑x)²][n∑y² – (∑y)²]}. Significance: t = r√[(n – 2)/(1 – r²)] with n – 2 degrees of freedom. Regression slope: b = r x (SD of Y / SD of X); intercept: a = Y mean – b x X mean.

There is a second way to see the same number that explains why r is unit-free. Convert every X and Y to a z-score, a count of standard deviations from its mean, and r is simply the average product of the paired z-scores: points that are high on both, or low on both, push r up, and mismatched points pull it down. That is why the area to z-score calculator is a useful companion when you are learning the standardization step. Penn State’s statistics course notes use the same definition and the same t-test for significance that this calculator runs, and OpenStax Introductory Statistics sets out the test’s assumptions: paired quantitative data, a roughly linear pattern, and no single point dominating the result.

Worked example, checked against this exact tool

The calculator is pre-filled with five pairs: X = 1, 2, 3, 4, 5 and Y = 2, 4, 5, 4, 6. Every figure below is what it returns.

OutputValueReading
Pearson’s r0.8528Strong positive
r-squared0.727372.7% of Y variance explained
X mean and SD3.0000, 1.5811Sample standard deviation
Y mean and SD4.2000, 1.4832Sample standard deviation
Regression liney = 1.8000 + 0.8000xLeast-squares fit
Significancet = 2.828, df = 3, p = 0.0663Not significant at 5%

The sums behind r are worth seeing once: ∑x = 15, ∑y = 21, ∑xy = 71, ∑x² = 55, ∑y² = 97. The numerator is 5 x 71 – 15 x 21 = 40, and the denominator is √{(5 x 55 – 225)(5 x 97 – 441)} = √{50 x 44} = 46.90, giving r = 40 / 46.90 = 0.8528. The slope of the regression line, 0.8000, is a different animal from r: it is in Y-units per X-unit, and the average slope calculator covers slope as a standalone concept when you need it for two endpoints rather than a fitted line.

What r and r-squared tell you, and what they hide

R answers one narrow question well: how tightly do the points hug a straight line? Its bands, as this calculator applies them, run from very weak under 0.30 through weak, moderate, and strong, to very strong at 0.90 and above. Those bands are conventions, not laws: in psychology an r of 0.30 can be a meaningful finding, while in instrument calibration anything under 0.99 is a problem.

Very weak (under 0.30)
0.00-0.29
Weak (0.30 to 0.49)
0.30-0.49
Moderate (0.50 to 0.69)
0.50-0.69
Strong (0.70 to 0.89)
0.70-0.89
Worked example r
0.8528
Very strong (0.90 to 1.00)
0.90-1.00

What r hides matters just as much. A perfect U-shaped relationship can return r near zero, because no straight line fits a curve. One extreme outlier can manufacture an r of 0.85 out of a shapeless cloud, or destroy a real one. And r says nothing about cause. Always picture the scatterplot before quoting the number; the statistic summarizes a shape it cannot show you.

The significance test: why n is half the story

The test asks whether an r this size could plausibly appear if the population correlation were zero. It converts r to a t-statistic, t = r√[(n – 2)/(1 – r²)], and reads a two-tailed p-value from the t distribution with n – 2 degrees of freedom, computed here through the incomplete beta function rather than a lookup table.

The worked example is the perfect cautionary case. R = 0.8528 looks decisive, yet with n = 5 the test gives p = 0.0663, just over the 5% line: five pairs can line up this well by chance about one time in fifteen. Hold r fixed and grow the sample and the verdict flips fast, because t grows with √(n – 2). At n = 12 the same r gives t of about 5.2 and a p-value under 0.001. Report r, n, and p together; quoting any one of them alone misleads.

What competing calculators miss

Most correlation tools in the search results return r and stop, and a few add a chart. The gaps that matter are quieter than that.

Miss 1: no significance test. R without a p-value invites overconfidence, above all on the small samples students and analysts actually paste in. This calculator runs the full t-test and states the verdict in plain words next to the numbers.

Miss 2: no regression line. Half the people computing a correlation want the line that goes with it. The slope and intercept are in the same result block here, derived from the same sums, so the two never disagree.

Miss 3: silent failure on constant data. When every X is identical, many tools return NaN or, worse, 0, which reads as no correlation when the truth is no correlation can be defined. This one names the problem and stops.

One honest limit: this is a Pearson-only tool. It does not compute Spearman’s rank correlation, draw the scatterplot, or flag outliers for you, so curved or outlier-driven data still needs your eyes on a plot before you trust the output.

Frequently Asked Questions

Pearson’s r is the standard correlation coefficient for linear relationships. It runs from -1 to +1: +1 is a perfect upward line, -1 is a perfect downward line, and 0 means no linear relationship at all. This calculator computes it from paired X and Y values using the sums formula shown in the formula section.

It depends on the field, but the bands this calculator uses are a common guide: 0.90 and up is very strong, 0.70 to 0.89 is strong, 0.50 to 0.69 is moderate, 0.30 to 0.49 is weak, and below 0.30 is very weak. A moderate r from a large, clean sample is usually worth more than a strong r from five noisy points.

R-squared is r multiplied by itself, and it reads as the share of Y’s variation that the linear relationship with X accounts for. An r of 0.8528 gives an r-squared of 0.7273, meaning about 72.7% of the variation in Y tracks X in the sample data. The other 27.3% is down to everything else, including noise.

The p-value is the probability of seeing an r at least this large in a sample of this size if there were truly no correlation in the population. Small samples produce large r values by luck surprisingly often: with only 5 pairs, even r = 0.8528 gives p = 0.0663, which misses the usual 5% significance line.

Because significance depends on sample size as much as on r. The t-statistic grows with the square root of n – 2, so the same r = 0.85 that is inconclusive at n = 5 becomes clearly significant at n = 12 or 15. Collect more pairs before concluding anything either way.

R is undefined. Correlation measures how Y moves as X moves, and if X never moves there is nothing to measure: the formula divides by zero variance. This calculator detects that case and tells you plainly instead of returning a fake number.

No. A strong r says two variables move together in your data. It cannot say one causes the other: a third variable may drive both, the causation may run the other way, or the pairing may be coincidence, which is exactly what the significance test is there to screen for.

Use Spearman’s rank correlation when your data are ranks or ordered categories, when the relationship is curved but steadily rising or falling (monotonic rather than linear), or when a few extreme outliers would dominate Pearson’s r. This calculator is Pearson-only, so if a scatterplot shows a clear curve, treat its r as a lower bound and switch methods.

The least-squares line y = a + bx that best predicts Y from X in your sample. Its slope is r scaled by the ratio of the two standard deviations, and it always passes through the point (X mean, Y mean). In the worked example the line is y = 1.8000 + 0.8000x.

Two pairs is the mathematical minimum, and the calculator accepts it, but the significance test has almost no power at tiny samples. Treat anything under about 10 pairs as exploratory, and aim for 20 or more pairs before relying on the p-value.

Add This Calculator to Your Website

Embed the Correlation Coefficient Calculator on your own site. Pick a size to preview it live, then copy the code.

Powered by Calculator Zilo

References

  1. Penn State University, STAT 200 course notes: correlation strength guidelines, the t-test for a population correlation, and its assumptions. Penn State STAT 200: Correlation. Accessed October 2026.
  2. OpenStax, Introductory Statistics: testing the significance of the correlation coefficient, including the critical-value method and test assumptions. OpenStax Introductory Statistics: Significance of the Correlation Coefficient. Accessed October 2026.
  3. Frank Harrell, Biostatistics for Biomedical Research: Pearson and Spearman correlation, Fisher’s z transformation, and confidence intervals for r. Biostatistics for Biomedical Research: Correlation and Nonparametric Regression. Accessed October 2026.
  4. Richard Lowry, VassarStats: the significance test for the Pearson product-moment correlation coefficient and its t distribution basis. VassarStats: Significance of a Correlation Coefficient. Accessed October 2026.
  5. CourseKata, Improving Psychological Research Methods and Data Science: the correlation coefficient as the slope of the standardized regression line. CourseKata: The Correlation Coefficient, Pearson’s R. Accessed October 2026.

Related calculators

Statistics CalculatorsSample Mean Calculator: Free Stats Tool OnlineThe sample mean is the average of a subset: add the values, divide by how many there are.Statistics CalculatorsProbability Mean Calculator Probability and statistics play a vital role in mathematics, finance, economics, engineering, data science, and scientific research.Statistics CalculatorsStandard Deviation Probability CalculatorGiven a normal distribution's mean and standard deviation, this calculator finds the probability of falling...Statistics CalculatorsLinear Regression CalculatorLinear regression finds the straight line that fits your paired data best: the line whose squared misses, added up, are smaller than any other line's.Statistics CalculatorsStatistics CalculatorPaste a dataset and this calculator returns the full descriptive picture: count, sum, mean, median, mode,...Statistics CalculatorsMean Median Mode Calculator Give this calculator any list of numbers and it returns the mean, median and mode together, with every step...

CalculatorZilo

Free calculators for everything. Accurate, fast, no signup.

Categories

Finance Math Health & Fitness Education Science Real Estate Chemistry Browse all calculators

Legal

Privacy Policy Terms and Conditions Disclaimer Cookie Policy DMCA Policy

Company

About Us Contact Us FAQ Accessibility Statement

We use cookies to analyze traffic and to serve ads that keep our calculators free. You can accept or decline cookies below. Learn more

© 2026 CalculatorZilo. All rights reserved.

  • Home
  • Calculators
    • Finance
    • Math
    • Health & Fitness
    • Education
    • Science
    • Real Estate
    • Chemistry
  • About Us
  • Contact Us
Search