Forecast future sales using linear regression (least squares). Enter historical data points and get trend-based projections with confidence insights.
Linear sales forecasting is one of the most intuitive and widely-used methods for predicting future revenue. By fitting a straight line through your historical sales data using least-squares regression, it identifies the underlying growth trend and extends it forward to generate forecasts. The method works by minimizing the sum of squared differences between actual data points and the fitted line, creating the mathematically optimal trend.
While more sophisticated forecasting methods exist, linear regression remains invaluable for its simplicity, interpretability, and reliability with reasonably stable growth patterns. It answers the fundamental question: if current trends continue, where is my revenue heading? The slope of the line tells you your average period-over-period revenue change, while the intercept provides the baseline.
This calculator lets you enter historical revenue data points, automatically computes the best-fit line, and projects revenue forward. It also calculates R² (coefficient of determination) so you can assess how well the linear model fits your data and how much confidence to place in the forecast.
Linear forecasting cuts through data noise to reveal your actual growth trajectory. Instead of reacting to individual months of ups and downs, it shows the statistical trend across all your data. This calculator handles the regression math instantly, gives you a quality-of-fit metric (R²), and projects forward so you can plan hiring, budgets, and targets based on data rather than gut instinct.
y = mx + b (Linear equation) m (slope) = [nΣxy − ΣxΣy] / [nΣx² − (Σx)²] b (intercept) = [Σy − mΣx] / n R² = 1 − [SS_res / SS_tot] where SS_res = Σ(y_i − ŷ_i)² and SS_tot = Σ(y_i − ȳ)²
Result: Trend: +$7,371/period • R²: 0.93
With 6 data points showing general upward movement, the linear regression finds a best-fit slope of $7,371 per period and an intercept of $99,067. The R² of 0.93 indicates the linear model explains 93% of the variance in the data, suggesting high confidence in the trend. The forecast for period 7 is $150,667 and period 12 is $187,519.
Linear regression finds the line that minimizes the total squared distance between each data point and the line itself. This "best fit" line represents the average trend in your data, smoothing out period-to-period volatility. The resulting equation gives you two valuable parameters: the slope (growth per period) and the intercept (theoretical starting value).
Beyond the raw forecast numbers, the regression output tells a story about your business. A steep positive slope combined with high R² indicates strong, consistent growth. A positive slope with low R² suggests growth that's happening but is volatile and harder to predict. Look at both the direction and the confidence to make well-calibrated decisions.
The most effective forecasters combine statistical models like linear regression with qualitative judgment. The model provides an objective baseline, while human judgment adjusts for known upcoming events, competitive changes, and strategic initiatives that historical data can't capture. Use the linear forecast as your starting point, then overlay domain expertise.
As your forecasting needs grow, consider graduated upgrades: polynomial regression for acceleration patterns, exponential models for high-growth businesses, ARIMA for time series with complex patterns, and machine learning models for large datasets. Linear regression remains the foundation — start here, and move to more complex models only when the data clearly justifies the added complexity.
Linear regression forecasting fits a straight trend line through historical data using the least-squares method. The line equation y = mx + b tells you the starting point (b) and the growth per period (m). By extending this line beyond your data, you get a forecast that assumes the historical trend continues. It's the simplest form of statistical forecasting and works well when growth is approximately constant.
R² (R-squared or coefficient of determination) measures how well the linear model fits your data. It ranges from 0 to 1, where 1 means the line perfectly explains all variation in the data. An R² of 0.9 means the linear trend explains 90% of revenue variation. Higher R² means more confidence in the forecast. Below 0.5, the linear model may not be appropriate for your data.
Statistically, you need at least 4 data points to fit a meaningful line, but more is better. For monthly data, 12+ months provides a full seasonal cycle. For quarterly data, 2+ years (8+ data points) is ideal. With fewer than 6 points, the forecast is highly sensitive to individual data values and should be treated as rough directional guidance rather than a precise prediction.
Linear forecasting is inappropriate when: growth is exponential rather than constant (early-stage startups), there are strong seasonal patterns, there's a known structural change ahead (product launch, market entry), or R² is low. In these cases, consider exponential models, seasonal adjustment methods, or scenario-based forecasting. Linear models also don't account for market saturation.
Basic linear regression ignores seasonality. If your business has strong seasonal patterns, either: (1) use year-over-year data points instead of sequential months, (2) deseasonalize the data first using seasonal indices, or (3) compare actual results to the linear trend to identify seasonal patterns. Our seasonal sales adjustment calculator handles this specifically.
The slope (m in y = mx + b) represents the average change in revenue per period. A slope of $10,000 means revenue grows by approximately $10,000 each period on average. A positive slope indicates growth, negative indicates decline. Dividing the slope by the average revenue gives you an approximate percentage growth rate that enables comparison across different revenue scales.
Technically yes, but accuracy decreases rapidly with longer forecasts. A general guideline is to forecast no more than one-quarter to one-third of your historical data length. If you have 12 months of data, forecasting 3–4 months ahead is reasonable. Longer forecasts should be treated as scenarios rather than predictions, since the further out you go, the more likely conditions will change.
Linear regression considers all data points equally and extrapolates the trend. Moving averages smooth recent data and essentially forecast that the recent level will continue, without explicitly modeling a trend. Linear regression is better for identifying and projecting growth trends, while moving averages are better for stable businesses where recent performance is the best predictor.