Correlation coefficient calculator

Pearson r measures how close five points lie to a straight line, from -1 through 0 to +1. The regression slope comes out of the same sums.

Pearson correlation r
0.987 878
≈ Rounded Strong positive
R squared Share of the variance in y explained by x.
0.975 904
Regression slope
1.800 000
Regression intercept
0.200 000
Show the working
  1. x1 = 1
  2. y1 = 2
  3. x2 = 2
  4. y2 = 4
  5. x3 = 3
  6. y3 = 5
  7. x4 = 4
  8. y4 = 8
  9. x5 = 5
  10. y5 = 9
  11. n = 5 = 5
  12. sx = 1+2+3+4+5 = 15
  13. sy = 2+4+5+8+9 = 28
  14. sxy = 1*2 + 2*4 + 3*5 + 4*8 + 5*9 = 102
  15. sxx = 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55
  16. syy = 2^2 + 4^2 + 5^2 + 8^2 + 9^2 = 190
  17. num = 5*102 - 15*28 = 90
  18. den = sqrt((5*55 - 15^2) * (5*190 - 28^2)) = 91.1043
  19. Pearson correlation r = 91.1043 != 0 ? 90/91.1043 : 0 = 0.987 878
  20. R squared = 0.987 878^2 = 0.975 904
  21. Regression slope = (5*55 - 15^2) != 0 ? 90/(5*55 - 15^2) : 0 = 1.8
  22. Regression intercept = (28 - 1.8*15)/5 = 0.2

Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.

Scenarios & local history

Compare a saved scenario

Recent calculations

    The formula

    • r = (n sum(xy) - sum(x) sum(y)) / sqrt((n sum(x^2) - sum(x)^2)(n sum(y^2) - sum(y)^2))
    • slope = (n sum(xy) - sum(x)sum(y)) / (n sum(x^2) - sum(x)^2)

    Correlation measures linear association only. A perfect parabola has an r near zero.

    Related calculators

    Settings

    Theme

    System follows your operating system and changes with it.

    Text size
    High contrast

    Maximises text and border contrast and removes the grid background.

    Graph-paper background

    Round to
    Notation
    Thousands separators
    Decimal mark
    Nearest fraction

    Shows the result as the nearest tape-measure fraction, with the error it costs.


    Accessibility & interaction
    Reduce motion Stops interface animations even when the operating system does not.
    Underline links Keeps links visually distinct without relying on colour.
    Larger touch targets Makes buttons and form controls easier to tap.
    Shorter reading lines Limits article width for easier scanning.
    Monochrome display Removes colour as an information cue.
    Always-visible focus Makes the keyboard focus ring persistent and stronger.
    Verbose screen-reader results Announces the complete conversion equation.
    Sticky action bars Keeps converter and calculator actions within reach.
    Select values on focus Replaces a value immediately when you start typing.
    Left-handed mobile layout Moves key mobile actions toward the left thumb.

    Your data

    Settings, recent conversions and favourites live in this browser only. Nothing is sent anywhere.

    Offline library