About the Correlation Calculator
Do taller people weigh more? Do students who study longer score higher? Do sales rise with advertising spend? The correlation coefficient answers questions like these with a single number between −1 and +1 that measures how closely two variables follow a straight line. It is one of the most widely used statistics in science, business and everyday data analysis.
This correlation calculator finds Pearson's r for two lists of paired values. It describes the strength and direction of the relationship, gives r² — the share of variation the two variables have in common — and tests whether the correlation is statistically significant. It also gives Spearman's rank correlation, a version that works on the order of the values and is less affected by outliers and curved relationships.
How to Use the Correlation Calculator
Enter the X values and the Y values in two boxes, in the same order, so that the first X goes with the first Y and so on. Separate values with commas, spaces or new lines — you can paste two columns from a spreadsheet.
At least three pairs are needed, though far more give a more reliable answer.
The Formula
r = Sxy ÷ √(Sxx × Syy)
Sxy = Σ (x − x̄)(y − ȳ)
Sxx = Σ (x − x̄)² Syy = Σ (y − ȳ)²
significance: t = r √(n − 2) ÷ √(1 − r²), df = n − 2
Step-by-Step Example
Hours studied (2, 3, 5, 7, 9) and test scores (65, 70, 75, 85, 90).
x̄ = 26 ÷ 5 = 5.2 ȳ = 385 ÷ 5 = 77
Sxy = 118 Sxx = 32.8 Syy = 430
r = 118 ÷ √(32.8 × 430) = 118 ÷ 118.76 = 0.9936
r² = 0.9872
t = 0.9936 × √3 ÷ √(1 − 0.9872) = 15.23, p = 0.0006
There is a very strong positive relationship: students who studied longer scored higher, and study time accounts for about 98.7 percent of the variation in scores in this small sample. Spearman's ρ is exactly 1, because the scores rise in perfect step with the hours.
Interpreting r
±0.9 to 1.0 very strong
±0.7 to 0.9 strong
±0.4 to 0.7 moderate
±0.2 to 0.4 weak
0 to 0.2 very weak or none
These labels are only a guide. In physics a correlation of 0.9 might be disappointing, while in psychology or economics 0.3 can be an important finding. The sign shows the direction: positive when the variables rise together, negative when one falls as the other rises.
Correlation Is Not Causation
A strong correlation does not show that one variable causes the other. Ice cream sales and drowning deaths are positively correlated, but both are driven by hot weather. Towns with more churches have more crime, because both grow with population. Sometimes the causation runs the opposite way to what you might assume, and sometimes a correlation is simply coincidence — with enough variables, some will line up by chance. Establishing cause needs controlled experiments or careful study design.
Only Straight Lines
Pearson's r measures linear association. A perfect U-shaped relationship, such as performance against stress, can have a correlation near zero, because the rising and falling halves cancel out. Always plot the data. Spearman's ρ captures any relationship that consistently rises or falls, even if it curves, but it too misses U-shapes.
Outliers and Restricted Ranges
A single extreme point can create or destroy a correlation. Adding one point far from the rest can pull r from near 0 to above 0.8, or the reverse. Restricting the range also weakens correlations: the link between school grades and university results looks weaker among students admitted to a selective university than across all students, because the admitted group has a narrow range of grades. Spearman's ρ is less sensitive to outliers because it uses ranks rather than raw values.
Significance and Sample Size
Whether a correlation is statistically significant depends heavily on the number of pairs. With 5 pairs, r must exceed about 0.88 to be significant at the 5 percent level; with 30 pairs, about 0.36; with 1,000 pairs, just 0.06. So a large sample can make a trivially weak correlation "significant", while a small sample can leave a strong one unproven. Look at the size of r and its practical meaning, not only the p-value, and report the number of pairs alongside it.
Pearson or Spearman?
Use Pearson's r when both variables are measured on a numeric scale, the relationship looks roughly linear, and there are no extreme outliers. Use Spearman's ρ when the data is ranked or ordinal — such as positions in a league or survey ratings from 1 to 5 — when the relationship is consistently increasing or decreasing but curved, or when a few extreme values would dominate Pearson's r. When the two measures agree closely, as in the example, you can be more confident the relationship is genuine.
Understanding Your Result
The headline is Pearson's correlation coefficient r.
The strength line describes the relationship in words.
The shared variation line gives r² as a percentage.
The significance line gives the p-value for testing whether r differs from zero.
The rank correlation line gives Spearman's ρ.
When Should You Use This Calculator?
Use it to measure how closely two measurements move together.
Use it to explore relationships in business, science or survey data.
Use it to check whether a relationship is statistically significant.
Use it for statistics coursework on correlation.
Common Mistakes
Assuming causation. Correlation shows association only.
Mismatching the pairs. Each X must line up with its own Y.
Ignoring curves. A low r does not rule out a strong non-linear relationship.
Letting one outlier decide the result. Check a scatter plot.
Over-reading small samples. With few pairs, r can be large by chance.
Combining different groups. Pooling groups with different averages can create a misleading correlation that exists within neither group.