Smekys
Ad Space

Correlation Coefficient Calculator

Free correlation coefficient calculator: compute the Pearson r, r-squared and p-value from two paired data sets. Fast, accurate, no sign-up.

Enter Values

How many (x,y) pairs you have (3 to 7 minimum for a meaningful r).

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Leave 0 if you do not have a 6th pair (0 means 'no data', not the number zero).

Leave 0 if you do not have a 6th pair (0 means 'no data', not the number zero).

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Paired observation for the X/Y dataset.

Leave 0 if you do not have a 6th pair (0 means 'no data', not the number zero).

Leave 0 if you do not have a 6th pair (0 means 'no data', not the number zero).

%

Confidence interval for r, derived with the Fisher z transform. 95% is the standard.

Result

Pearson Correlation Coefficient (r)
1
Coefficient of Determination (r²)
1
Regression Slope (b1)
2
t Statistic
0
p-value (two-tailed, Fisher z approx.)
0
Strength |r|
1
Fisher Confidence Interval — Lower
1
Fisher Confidence Interval — Upper
1
Number of Pairs (N)
5
Mean of X
3
Mean of Y
6

The correlation coefficient is the single number that tells you whether two variables move together, move in opposite directions, or do not seem related at all. This calculator computes the Pearson correlation coefficient (r), the coefficient of determination (r²), and the two-tailed p-value from two columns of paired data — so you can see not only how strong the relationship is, but also whether it is statistically meaningful.

Enter your paired data points, and the result appears instantly: r on a scale from −1 (perfect negative) to +1 (perfect positive), r² as the percentage of shared variance, and a p-value that answers "could this be luck?". You must enter at least three pairs — below that, a single outlier swings r wildly. If you have fewer than seven pairs, leave the unused X6/Y6 and X7/Y7 boxes at 0; 0 means "no data here," not the number zero.

How to Read the Results

The result card shows several numbers that answer different questions. Read them one at a time:

  • Pearson r — the headline. Direction and strength of the linear relationship, from −1 to +1.
  • r² — the share of variation in Y "explained" by the linear relationship with X, from 0 to 1.
  • Regression slope (b1) — how much Y changes for a one-unit rise in X.
  • t statistic — how far r is from zero in units of its own noise; near zero when r is near zero. It is reported as 0 for a perfect fit (|r| = 1) where the t-test itself is undefined.
  • p-value — if there were truly no relationship, how often would we see an r this extreme by luck? Below 0.05 is the conventional "interesting" cutoff.
  • Fisher confidence interval — the lower and upper bounds for r in the population, at whatever confidence level you picked (default 95%). If the interval crosses 0, the sample is too small to claim a relationship.
  • Means of X and Y — the two averages, useful for checking you entered the columns in the right order.

If one of your variables is a constant (all values identical), the denominator is zero and r is mathematically undefined; the calculator returns r = 0, p = 1 rather than a nonsense number.

How to Use

  1. Set the Number of Pairs (N) to how many (x,y) points you have — up to 7.
  2. Enter each X value in the X1…X7 boxes and the matching Y value in Y1…Y7 in the same order. If X1 is "hours studied" for student Anna, then Y1 must be Anna's score. Extra boxes default to 0 — leave them at 0 if you have fewer than 7 pairs.
  3. Keep the default Confidence Level at 95%, or change it to 90% or 99% if your field uses a different convention.
  4. Read the result card: Pearson r is the headline number, r² tells you the proportion of variance explained, and the p-value tests the null hypothesis of no linear relationship.
  5. Judge strength with the rule of thumb below: |r| ≥ 0.7 is strong, 0.3–0.7 moderate, below 0.3 weak.

You need at least three paired values for a meaningful coefficient; with fewer, r is not reliable. If one of your variables is a constant (all values identical), the denominator becomes zero and r is mathematically undefined — the calculator flags this instead of producing a meaningless number.

The Pearson Formula

The Pearson correlation coefficient is the standardized covariance between X and Y:

r = Σ(xᵢ − x̄)(yᵢ − ȳ) / √[ Σ(xᵢ − x̄)² · Σ(yᵢ − ȳ)² ]

Where x̄ and ȳ are the means of the two samples. The numerator measures how the two variables vary together; the denominator scales that joint variation by each variable's own spread, which is why r always lands between −1 and +1 regardless of the units of your data.

A value of +1 means a perfect uphill line — as X rises, Y rises proportionally. −1 means a perfect downhill line. 0 means no linear relationship at all. The common rule of thumb:

  • |r| ≥ 0.7 — strong correlation
  • 0.3 ≤ |r| < 0.7 — moderate correlation
  • |r| < 0.3 — weak correlation

The r² value (the coefficient of determination) is often more intuitive: if r = 0.80, then r² = 0.64, meaning 64% of the variation in Y is explained by the linear relationship with X. The rest comes from other factors or noise.

What the p-value Means

The p-value answers a specific question: if there were truly no linear relationship in the population, how likely would we be to see an r at least this extreme just by sampling luck? The engine applies the Fisher r-to-z transformation (z = atanh(r), SE = 1/√(N−3)) and uses a standard normal tail approximation, which is the conventional large-sample test for correlation. For small samples (N < 10) this is an approximation; cross-check against a t-table with df = N−2 for publication-grade work.

A p-value below 0.05 is the conventional threshold for "statistically significant." But remember the trap: with very large samples, even a trivial r = 0.05 can be "significant," while with small samples a strong-looking r = 0.60 may not be. Always report both r and the p-value together, and never confuse significance with practical importance. The output card also shows the regression slope b1 (the amount Y changes for a one-unit rise in X) and the t-statistic for diagnostics.

Examples

Example 1 — Study time vs. test score (strong positive). A teacher records seven students: study hours 1, 2, 3, 4, 5, 6, 7 and scores 65, 70, 72, 78, 80, 85, 88. The calculator returns r ≈ 0.998, r² ≈ 0.996, and a p-value well below 0.001 — a strong, statistically significant positive relationship. Roughly 99% of the variation in scores is explained by study time in this dataset.

Example 2 — Advertising spend vs. weekly sales (moderate-to-strong positive). A small business spends $100, $200, $300, $400, $500, $600, $700 and books sales of $220, $430, $590, $780, $960, $1,180, $1,350. The result is r ≈ 0.999 with r² ≈ 0.999: spend and sales track almost perfectly in this window. Caution, though — seven weeks of data can reflect seasonality or a single promotion, so correlation here is not proof that spending more caused the extra sales.

Example 3 — Absences vs. final grade (strong negative). Absences 0, 1, 2, 3, 4, 5, 6 map to grades 98, 91, 85, 79, 72, 66, 60. The calculator returns r ≈ −1.000 — a near-perfect negative linear relationship: each missed day is associated with about a 6-point drop. The negative sign simply points the relationship downhill; its strength is judged by |r|.

Example 4 — The parabola trap (r = 0 but not "no relationship"). X = −3, −2, −1, 0, 1, 2, 3 and Y = 9, 4, 1, 0, 1, 4, 9 (Y = X²). Pearson r comes out 0.000, yet the points trace a clean U-shape. This is the classic warning: Pearson r measures linear association only. A zero coefficient says "no straight-line trend," not "no relationship whatsoever."

FAQ

How do I interpret a correlation coefficient of 0.8?

An r of 0.8 is a strong positive correlation: as one variable rises, the other tends to rise with it, fairly reliably. Squaring it gives r² = 0.64, so about 64% of the variation in the second variable is explained by the linear relationship with the first.

What does a negative correlation mean?

A negative r means the two variables move in opposite directions: as one goes up, the other tends to go down. Example: hours of absence and exam score. The sign only tells direction; the magnitude |r| tells strength, so r = −0.85 is just as strong as r = +0.85.

What is the difference between r and r-squared?

r is the signed correlation coefficient, ranging from −1 to +1, measuring both direction and strength of the linear association. r² is the square of r, ranging from 0 to 1, and is the proportion of variance in one variable explained by the other. It is always positive and is easier to explain to non-technical audiences as a percentage.

Is a correlation of 0.5 considered good?

It depends on your field. In social sciences, r = 0.5 is considered strong; in physics or engineering, where measurements are cleaner, 0.5 would look weak. In business and marketing, r = 0.3–0.5 between spend and revenue is common and often meaningful. Judge it against r² and your sample size, not against an absolute textbook benchmark.

Can correlation ever prove causation?

No. Correlation measures association only. Two variables can move together because a hidden third factor drives both (ice cream sales and drowning both rise in summer), or because the relationship is coincidental in your particular sample. A controlled experiment, or a well-designed longitudinal study, is required before claiming causation.

How many data points do I need?

The minimum for a stable Pearson r is about 5–10 paired points; below that, a single outlier swings the coefficient wildly. With 30 or more pairs the estimate becomes reasonably stable, and the p-value becomes dependable. The calculator requires at least three values to run at all.

Why is my p-value significant even when r is small?

Because the p-value depends on sample size as well as effect size. With hundreds or thousands of observations, even r = 0.05 can fall below 0.05 by the conventional threshold. Always look at r and r² themselves — statistical significance is not the same as a relationship large enough to matter.

Disclaimer

This correlation coefficient calculator is provided for informational purposes only and does not constitute statistical, scientific, or business advice. Results are computed from the values you enter using the standard Pearson product-moment formula and the Student's t-distribution, and they may differ slightly from spreadsheet or textbook outputs due to rounding. Always validate critical decisions with qualified analysts or peer-reviewed software before relying on them.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.