Skip to main content
Calcimator

Correlation Calculator

Calculate the Pearson correlation coefficient (r), coefficient of determination (r²), and test significance from summary statistics.

About this calculator

This calculator computes the Pearson correlation coefficient r and its significance test purely from six summary sums — Number of Data Points (n), Σxy, Σx, Σy, Σx², and Σy² — rather than raw paired data, using r = (nΣxy − ΣxΣy) / √(|nΣx²−(Σx)²| × |nΣy²−(Σy)²|) (lines 12-17). Degrees of Freedom is the simplest output here: it's exactly n − 2 (line 21) and is completely unaffected by any of the five sum inputs — only Number of Data Points moves it. T-Statistic responds far more strongly to Σx than to any other input at the calculator's defaults, since Σx feeds directly into both the numerator and one of the two denominator terms of r, and the resulting t-statistic is itself a steep function of r near the calculator's default correlation strength.

The P-Value calculation branches on an exact condition — Degrees of Freedom at least 30 uses the plain normal approximation, otherwise a small-sample adjustment (adjustedZ = |t| × √(df/(df+1))) is applied first (lines 30-35) — and at the default 10 data points (df = 8), every calculation runs through that small-sample branch, which a reader wouldn't see unless Number of Data Points is set to 32 or more. Number of Data Points is never rounded to a whole number anywhere in this engine, despite conceptually representing a count of paired observations — a fractional value like 10.5 is used exactly as typed throughout every formula. This calculator does not compute a correlation from a raw list of (x, y) pairs — you have to supply the six sums yourself, so any arithmetic mistake in deriving those sums from your original data will silently produce a wrong but plausible-looking r.

Inputs

Results

Correlation Coefficient (r)

0.47

R-Squared (r²)

0.22

T-Statistic1.51
P-Value (two-tailed, approx)0.15
Degrees of Freedom8
Significant at α=0.05 (1=Yes)0
Strength (0=none, 1=weak, 2=mod, 3=strong, 4=very strong)2
How to Use This Calculator
  1. Enter Number of Data Points (n), Sum of XY (Σxy), and Sum of X (Σx).
  2. Set Sum of Y (Σy), Sum of X² (Σx²), and Sum of Y² (Σy²).
  3. Review Correlation Coefficient (r) and R-Squared (r²).
  4. Use T-Statistic and P-Value (two-tailed, approx) to inform your decision.
  5. Use the chart to visualize the results and explore different scenarios by adjusting inputs.

How the result changes with Sum of XY (Σxy)

Sum of XY (Σxy)Correlation Coefficient (r)R-Squared (r²)
1,925-3.6513.35
2,888-1.592.53
5,7754.621.13
9,62512.85165.01

What each input means

Number of Data Points (n)
Total number of paired observations. Must be at least 3.
Sum of XY (Σxy)
Sum of the products of each paired x and y value.
Sum of X (Σx)
Sum of all x values in the data set.
Sum of Y (Σy)
Sum of all y values in the data set.
Sum of X² (Σx²)
Sum of each x value squared.
Sum of Y² (Σy²)
Sum of each y value squared.

How this is calculated

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Number of Data Points (n) = 10, Sum of XY (Σxy) = 3850, Sum of X (Σx) = 55, Sum of Y (Σy) = 660 = 6 input(s) provided
  2. Calculate Correlation Coefficient
    Correlation Coefficient
    0.4714 = 0.4714
  3. Calculate R-Squared
    R-Squared
    0.2222 = 0.2222
  4. Calculate T-Statistic
    T-Statistic
    1.5119 = 1.5119
  5. Calculate P-Value
    P-Value
    0.154 = 0.154

Engine last updated . Checked against 3 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.

Frequently Asked Questions

Does Σy or Σy² affect the Degrees of Freedom shown?

No — Degrees of Freedom is exactly Number of Data Points minus 2 (line 21) and reads nothing else; none of the five sum inputs (Σxy, Σx, Σy, Σx², Σy²) has any effect on it at all.

When does the P-Value calculation switch to the small-sample adjustment?

Whenever Degrees of Freedom is below 30, meaning Number of Data Points is under 32 (line 30) — which includes the calculator's own default of 10 data points. Below that threshold, the T-Statistic is first scaled by the square root of df / (df + 1) (line 33) before being converted to a P-Value; at 32 or more data points, that adjustment is skipped entirely.

Can I enter a fractional value like 10.5 for Number of Data Points?

The engine will accept it and use it exactly as typed in every formula (line 4) — there's no rounding to a whole number anywhere in this calculator, even though Number of Data Points conceptually represents a count of paired observations.

Do I need my raw x and y data pairs to use this calculator?

No, but you do need to have already computed six summary sums from them yourself — Σxy, Σx, Σy, Σx², Σy², and the count n — since the engine only ever operates on those six numbers (lines 4-9) and has no way to check whether they were derived correctly from an underlying dataset.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Math & Statistics.