Correlation Coefficient Calculator
Compute the Pearson correlation coefficient between two data series. See r, r² and the direction and strength of the relationship.
Comma-separated, e.g. 1, 2, 3, 4, 5.
Same count as X, e.g. 2, 3, 5, 7, 9.
Correlation (r)
0.9939
Coefficient of determination (r²)
0.9878
Pairs (n)
5
r ranges from −1 (perfect inverse) to +1 (perfect positive). A constant series has no defined correlation.
Last updated: August 2026
How this calculator is verified
Checked by True Calculator automated test suite on
- Formula verified against a published worked example in the automated test suite
- Edge cases (zero, negative, boundary and unit-mismatch inputs) covered by unit tests
The full verification method is on our how we verify page. Found an error? Tell us and we will re-check it.
When to Use This Calculator
Use the correlation coefficient calculator whenever you want a single number summarizing how two variables move together — marks versus study hours, rainfall versus crop yield, ad spend versus sales, gold prices versus the Sensex. Analysts across India use r to screen relationships before building regression models, since a near-zero correlation warns that linear modelling will be fruitless, while a strong one justifies deeper analysis. Students of statistics and economics verify their manual calculations in seconds, and finance learners study the contrast between positively correlated assets and negatively correlated hedges. The calculator also reports r², the coefficient of determination, which quantifies the share of variation explained — the figure commonly quoted in research papers and business analytics dashboards.
How to Use This Calculator
- Step 1: Paste the first variable's values in the X box, comma-separated.
- Step 2: Paste the paired values of the second variable in the Y box, same count and order.
- Step 3: Check both lists have at least two pairs and are not constant series.
- Step 4: Read the correlation r, the coefficient of determination r² and the pair count.
Worked Example
An analyst in Mumbai studies five months of ad spend against online sales: spend (1, 2, 3, 4, 5 lakh) versus sales (2, 3, 5, 7, 9 lakh). Entering these as X and Y gives r = 0.9939 and r² = 0.9878 — an extremely strong positive relationship, with about 98.8% of the variation in sales explained by the spend trend. For contrast, swapping the sales order to (5, 4, 3, 2, 1) produces r = −1, a perfect inverse relationship, showing how the coefficient changes sign with the direction of the link.
Tips and Common Mistakes
- •Tip 1: Check for a linear pattern in a scatter plot first — r only measures straight-line relationships.
- •Tip 2: A single outlier can inflate or crush r, so inspect extreme points before trusting the value.
- •Tip 3: Compare r² rather than r when judging how much of one variable's variation the other explains.
- ✗Mistake 1: Entering lists of unequal length — the calculator rejects them, and silently padding would distort the result.
- ✗Mistake 2: Treating high correlation as causation; a third factor may drive both variables.
Frequently Asked Questions
What does the correlation coefficient measure?
The Pearson correlation r measures the strength and direction of a linear relationship between two variables, from −1 to +1. An r of +1 means a perfect positive line, −1 a perfect negative line, and 0 no linear relationship. Values above 0.7 or below −0.7 are generally considered strong.
Does correlation imply causation?
No. Two variables can be strongly correlated without one causing the other — both may be driven by a third factor, or the link may be coincidental. For example, ice-cream sales and drowning incidents both rise in summer. Correlation is evidence to investigate, not proof of cause and effect.
How is r calculated?
The calculator computes r = Σ(x−x̄)(y−ȳ) ÷ √(Σ(x−x̄)² × Σ(y−ȳ)²). For the dataset (1,2), (2,3), (3,5), (4,7), (5,9) the result is r ≈ 0.994, showing a very strong positive relationship. The r² value of about 0.988 tells you how much of the variation in y is explained by x.
What is the difference between r and r²?
r is the correlation coefficient, while r² (the coefficient of determination) is r squared and ranges from 0 to 1. r² states the fraction of variance in one variable explained by the other: r = 0.994 gives r² = 0.988, meaning roughly 99% of the variation is explained. r² is often quoted in regression and analytics reports.
Can I use it with Indian stock or business data?
Yes — analysts use correlation to study relationships like Sensex moves against gold prices, or ad spend against online sales. Paste the two time series side by side. Just remember correlation captures only linear co-movement: two assets can move together in a non-linear way and still show a low r.
You might also need
Related calculators from other categories
Date
Age Difference Calculator
Find the age difference between two dates in years, months and days, plus total days, weeks and months. See who is older at a glance.
Date
Date Difference Calculator
Count the exact days, weeks, months, years and business days between two dates, with hours and minutes too. Perfect for deadlines, leave and projects.
Math
Distance Calculator
Calculate Euclidean, Manhattan and Chebyshev distance between two points. Essential for geometry and data science.
Time
Hours Calculator
Calculate the hours and minutes between two times, including overnight shifts and seconds. See decimal hours, minutes and days at a glance.