Overview

Polynomial regression fits a curve of the degree you choose to your data, from a simple parabola up to degree 6.

Paste your x-y points, one per line, then pick a degree. Add an x value if you want a prediction.

Worked examples

InputsResult
Your x-y points1, 2.1 · 2, 3.9 · 3, 9.2 · 4, 15.8 · 5, 25.3 · 6, 35.9Degree3y = −0.066667x³ + 1.7857x² − 2.8619x + 3.2R²: 0.9998 from 6 points

How it works

The curve is chosen by least squares, which makes the squared vertical distances from the points to the curve as small as possible. Higher degrees follow the points more closely, but they can start following noise instead of the real trend.

The formula

y = a₀ + a₁x + a₂x² + … + aₙxⁿ
nThe degree you choose
a₀ … aₙCoefficients chosen to fit your points

Practical tips

  • Start at a low degree and only go higher if the chart shows a clear need.
  • A degree n fit needs at least n + 1 points with different x values.
  • High-degree curves can swing wildly between and beyond your points.

Frequently asked questions

What degree should I use?

The lowest one that captures the pattern. Degree 2 or 3 is enough for most data.

Why not always use a high degree?

It can pass close to every point while predicting new values badly, which is called overfitting.

Does a higher R² mean a better model?

Not always, because adding terms raises R² even when they add nothing real.