Calcupedia

Least Squares Regression Calculator

Math

Find the best-fit line (slope and intercept) through five data points using least squares regression.

Ad · Billboard
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000
-1,000,0001,000,000

Slope

0.6000

The slope of the best-fit line through the 5 points.

Intercept

2.2000

The y-intercept of the best-fit line, where it crosses x=0.

Share result
Reload calculator
Clear inputs

Found this calculator useful?

From Scratch To $10K/Month In 60 Days

This is a proven money making system that takes students by the hand to make at least $10,000 per month, every month. Students get 12 weeks of guided coaching in addition to the "MPS Super Funnel" and tools.

We value your privacy and promise not to sell or misuse your information. Here's our privacy policy.

Calculator Stats

Odeh Ahwal

Creators

Odeh Ahwal
Reviewed and verifiedThis calculator was reviewed and verified by the Calcupedia due diligence team.

0people find this calculator helpful

Views

Helpful

Saved

Embeds

Like
Share
Embed this calculator
Cite
Save
Ad · 300×250
Ad · 300×250

Frequently Asked Questions

What is least squares regression?

It finds the straight line that minimizes the total squared vertical distance between the line and each data point, giving the best-fitting straight-line summary of the relationship between x and y.

Why square the distances instead of just adding them up?

Squaring makes every distance positive (so points above and below the line don't cancel out) and penalizes larger errors more heavily, which produces a single well-defined best-fit line with a clean closed-form solution.

Why is this limited to exactly 5 points?

A fixed set of input fields is needed for each point's coordinates. Five points is enough to demonstrate a meaningful trend while keeping the input form manageable; the same formula extends to any number of points.

Spot a mistake? Tell us what's wrong.

Don't see what you need?

Request a calculator. The most-requested ones get built first in our monthly batch.

Request a calculator

Want this calculator on your website?

Embed the Least Squares Regression Calculator on any site — no code needed. Customize colors, remove branding, and track usage.

Embed it free →
Embed on any platform — Next.js, React, Vue.js, PHP, Laravel, Shopify, Wix, Webflow, Squarespace, and more