Pearson Correlation Calculator

Calculate Pearson r, r squared, covariance, and confidence interval for paired numeric data

Calculate Pearson's product-moment correlation coefficient.

Pearson r measures linear association between two numeric variables on a scale from -1 to 1. The result also includes r squared, covariance, an optional Fisher confidence interval, and the least-squares regression line.

Use this tool when you specifically need linear correlation rather than rank-based correlation.

Example Results

1 examples

Calculate Pearson r

Measure the linear relationship between study time and scores.

{
  "result": {
    "pearsonCorrelation": 0.9995,
    "rSquared": 0.999
  }
}
View input parameters
{ "pairedData": "1, 52\n2, 57\n3, 63\n4, 68\n5, 74", "xValues": "", "yValues": "", "decimalPlaces": 4, "confidenceLevel": 95, "includeRegressionLine": true }

Key Facts

Category
Math, Date & Finance
Input Types
textarea, text, number, checkbox
Output Type
json
Sample Coverage
3
API Ready
Yes

Overview

The Pearson Correlation Calculator is a statistical utility designed to measure the linear association between two numeric variables. By inputting paired data, you can instantly determine the Pearson correlation coefficient (r), R-squared value, covariance, and Fisher confidence intervals, making it easy to evaluate the strength and direction of linear relationships.

When to Use

  • When you need to measure the strength and direction of a linear relationship between two continuous numeric variables.
  • When evaluating the predictive power of a linear regression model using the R-squared value.
  • When determining if two sets of numeric data move together, such as comparing study hours to test scores or marketing spend to revenue.

How It Works

  • Enter your paired numeric data into the main text area, with one pair per line separated by a comma.
  • Alternatively, paste your X and Y values into their respective separate input fields as comma-separated lists.
  • Adjust the decimal places, confidence level, and toggle the regression line calculation as needed.
  • The tool processes the data and outputs a JSON result containing the Pearson r, R-squared, covariance, and regression formula.

Use Cases

Academic researchers analyzing the correlation between environmental factors and biological measurements.
Financial analysts comparing the historical price movements of two different assets to assess market correlation.
Educators evaluating the relationship between student attendance rates and final exam performance.

Examples

1. Analyzing Study Time vs. Test Scores

Educator
Background
A teacher wants to understand how the number of hours students study impacts their final exam scores.
Problem
Needs to calculate the linear correlation and regression line to predict future scores based on study habits.
How to Use
Paste the paired data (hours, score) into the Data Pairs field and ensure 'Include Regression Line' is checked.
Example Config
{
  "pairedData": "1, 52\n2, 57\n3, 63\n4, 68\n5, 74",
  "includeRegressionLine": true
}
Outcome
The tool outputs a Pearson r of 0.9995 and an R-squared of 0.999, indicating a near-perfect positive linear relationship, along with the regression equation.

2. Evaluating Marketing Spend vs. Revenue

Marketing Analyst
Background
An analyst has monthly data for advertising spend and the resulting sales revenue.
Problem
Needs to determine the R-squared value to see how much of the revenue variance is explained by ad spend.
How to Use
Input the ad spend in the X Values field and revenue in the Y Values field, setting the confidence level to 95%.
Example Config
{
  "xValues": "1000, 1500, 2000, 2500",
  "yValues": "5000, 6200, 7100, 8500",
  "confidenceLevel": 95
}
Outcome
Calculates the Pearson correlation and R-squared, providing statistical evidence of the marketing campaign's effectiveness and a 95% confidence interval for the correlation.

Try with Samples

math-&-numbers

FAQ

What does a Pearson r value of 1 or -1 mean?

A value of 1 indicates a perfect positive linear relationship, while -1 indicates a perfect negative linear relationship. A value of 0 means there is no linear correlation.

What is the difference between Pearson r and R-squared?

Pearson r measures the strength and direction of the linear relationship. R-squared represents the proportion of variance in the dependent variable that can be explained by the independent variable.

Can I input X and Y values separately?

Yes, you can either paste paired data (X, Y) on each line in the primary input or use the dedicated X Values and Y Values fields for comma-separated lists.

What is the Fisher confidence interval?

It is a statistical range that estimates the true population correlation coefficient based on your sample data and selected confidence level (e.g., 95%).

Does this tool calculate the regression line?

Yes, if the 'Include Regression Line' option is checked, the tool calculates the least-squares regression line equation alongside the correlation metrics.

API Documentation

Request Endpoint

POST /en/api/tools/pearson-correlation-calculator

Request Parameters

Parameter Name Type Required Description
pairedData textarea No -
xValues text No -
yValues text No -
decimalPlaces number No -
confidenceLevel number No -
includeRegressionLine checkbox No -

Response Format

{
  "key": {...},
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
JSON Data: JSON Data

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-pearson-correlation-calculator": {
      "name": "pearson-correlation-calculator",
      "description": "Calculate Pearson r, r squared, covariance, and confidence interval for paired numeric data",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=pearson-correlation-calculator",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]