1. What does this tool do
This free online correlation calculator shows how two variables relate—enter paired X and Y values and get Pearson correlation (r), Spearman correlation (ρ), covariance, and a scatter chart with a regression line. Use it as a Pearson correlation calculator or Spearman correlation calculator for homework, research, or quick checks on whether two datasets are related. No sign-up, no upload; all calculation runs in your browser. Your data never leaves your device. Ideal for statistics homework, research, quality checks, or finance (e.g. asset correlation).
2. How to use it
Quick start: Enter or paste X values and Y values (same length, comma or space separated). Click calculate to see Pearson r, Spearman ρ, covariance, and the scatter plot with regression line. Use presets for example datasets.
- Enter X values — Paste or type the first variable (e.g. hours studied). Comma or space separated.
- Enter Y values — Paste or type the second variable (e.g. test scores). Must have the same number of values as X.
- Calculate — Click the button to compute Pearson r, Spearman ρ, and covariance.
- View the chart — The scatter plot shows data points and the regression line.
- Try presets — Use Quick Presets for perfect positive, perfect negative, weak positive, or no correlation examples.
3. How it works
The tool parses both input strings into number arrays (comma or whitespace separated), validates they have the same length (minimum 2, maximum 10,000 pairs), and computes:
- Pearson r — Sample correlation coefficient: covariance(X,Y) / (σ_X × σ_Y). Measures linear association.
- Spearman ρ — Rank correlation: Pearson applied to rank-transformed data. Measures monotonic association.
- Covariance — Sample covariance of the two variables.
The scatter chart draws the linear regression (best-fit) line from your data. All computation runs entirely in your browser. No data is sent to any server.
4. Use cases & examples
- Statistics homework and correlation analysis — Compute Pearson and Spearman for paired data in statistics or psychology.
- Research — Explore relationships between variables (e.g. temperature vs. ice cream sales).
- Quality control — Check if two measurements or processes are related.
- Finance — Assess correlation between returns of two assets.
Example
Hours studied (X): 2, 4, 6, 8, 10
Test score (Y): 65, 72, 78, 85, 92
- Pearson r ≈ 0.99 (strong positive)
- Spearman ρ ≈ 1 (perfect rank correlation)
- The scatter chart shows points closely following an upward trend line.
5. Limitations & known constraints
- Paired data only — X and Y must have exactly the same length.
- Minimum 2 pairs — At least two (X, Y) pairs are required.
- Maximum 10,000 pairs — Very long lists may slow the UI.
- Linear regression — The fitted line assumes a linear relationship; it does not model curves.
- No significance testing — The tool does not compute p-values; use dedicated software for hypothesis testing.