About the Correlation Coefficient Calculator
This tool computes Pearson correlation r for paired X and Y values you type or paste. You get r, r squared (share of variation explained), the least squares best-fit line, the two-tailed p-value for r = 0, and the number of pairs. Everything runs in your browser; nothing is uploaded to a server. Results update instantly as you type, and you can copy results or share a link that reopens with your numbers. The calculator uses the standard Pearson formula and the t test for r, so it gives the same answers you would get from stat texts, Microsoft PEARSON, or NIST. The interface keeps input simple and quick for students, analysts, teachers and researchers who need fast, transparent checks of linear association.
How to use it
- 1Enter matching X values and Y values in the two input fields in the same order.
- 2Watch Pearson r, r², slope, intercept, p-value and pair count update instantly as you type.
- 3Copy the numeric results or click Share to create a link that reopens with your numbers.
Worked example
Input X: 1, 2, 3, 4, 5 and Y: 2, 4, 5, 4, 5. Results: r = 0.775, r² = 0.600 (60.0%), slope = 0.600, intercept = 2.200, p-value (two-tailed) ≈ 0.12, n = 5.
The formula
r = sum((x - mean x)(y - mean y)) / sqrt(sum((x - mean x)^2) x sum((y - mean y)^2))It runs from -1 (perfect falling line) to +1 (perfect rising line); 0 means no straight-line linkThe p-value tests r = 0 with t = r sqrt((n - 2) / (1 - r^2)) on n - 2 degrees of freedomThe best-fit line is least squares: slope = Sxy / SxxSource: Microsoft support: PEARSON functionNIST Dataplot reference: correlationPearson correlation coefficient (Wikipedia). Last checked 6 November 2026.
What it is good for
- Runs entirely in your browser, so inputs do not leave your computer.
- Shows r, r², slope, intercept, p-value and number of pairs instantly.
- Copy numeric results or share a link that reopens with your data.
- Computes Pearson r only; it does not compute Spearman rho or Fisher confidence intervals.
- Correlation measures association, not causation; check study design before making causal claims.
Questions people ask
What input format does the tool accept?
Enter matching X and Y values separated by commas, spaces or newlines. Each X must line up with the corresponding Y in the same order.
How many pairs do I need?
You need at least three pairs to compute r. For reliable inference you normally want many more than three; treat p-values and estimates with caution for very small samples.
What does the Strength result mean?
Strength follows a common rule of thumb: under 0.3 weak, 0.5 to 0.7 fairly strong, over 0.9 very strong. These cutoffs are approximate and different fields use different standards.
Does a high correlation prove causation?
No. Correlation only measures linear association. Causal claims require experimental design, longitudinal data or causal analysis outside this calculator.
How is the p-value calculated?
The tool uses t = r sqrt((n - 2)/(1 - r^2)) with n - 2 degrees of freedom and returns the two-tailed p-value for r = 0. This is the standard test in statistics texts.
Can I use commas as decimal separators or semicolon lists?
The tool expects dot decimals by default and accepts commas, spaces or newlines as separators. If your locale uses comma decimals, replace decimals with dots or paste values on separate lines to avoid ambiguity.
Help keep every tool free
FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.