Smooth a noisy numeric series with a cubic spline

Paste x,y data or a y-only series, pick the smoothing rule, and get fitted values, residuals, predictions, curve samples, or an SVG chart.

Try:
Spline fit

About this tool

Spline Smoother fits a natural cubic smoothing spline to noisy numeric data. Paste one y value per row, x,y rows with an optional header, a one-line list of y values, or JSON arrays/objects. The tool sorts by x, merges exact duplicate x values by weighted mean, and reports fitted values, residuals, leverage, effective degrees of freedom, selected lambda, RMSE, and optional predictions.

Use mode=auto when you want the tool to pick a penalty by generalized cross-validation or leave-one-out CV. Use mode=smoothing for a scale-free p slider: 0 is the weighted least-squares straight line and 1 interpolates the distinct data points. Advanced workflows can provide a raw non-negative lambda or a target effective df.

Worked example

Input:

x,y
1,2.1
2,3.9
3,6.2
4,7.8
5,10.3
6,11.7

With mode=auto, criterion=gcv, and output=json, the result includes a JSON report with the chosen smoothing penalty, fitted values for every observation, residuals, and RMSE. Switch output=svg for a quick raw-versus-fit chart, or set predict_at=1.5,3.5,5.5 to evaluate the fitted curve at custom x values.

Limits and edge cases

FAQ

What input formats can I paste?

You can paste one y value per row, two-column x,y rows separated by commas, spaces, tabs, or semicolons, a one-line list such as 10, 12, 11, 15, a JSON array of numbers, a JSON array of [x, y] pairs, or JSON objects with x and y fields. A non-numeric first row is treated as a header.

How should I choose between auto, smoothing, lambda, and df?

Start with auto and criterion=gcv for an objective default. Use smoothing when you want a slider-style control where lower values are smoother and 1 interpolates. Use lambda if you need to reproduce a known penalized-spline setting, or df when you want the fitted curve to have a particular effective degrees of freedom.

What does the coefficients option return?

When coefficients=true, JSON and CSV output include one row per interval with x_start, x_end, and cubic coefficients a, b, c, d. On that interval the fitted curve is a + b·(x-x_start) + c·(x-x_start)^2 + d·(x-x_start)^3.

Does the tool handle irregular spacing and duplicate x values?

Yes. X values can be irregular and unsorted. The tool sorts them before fitting. Exact duplicate x values are merged into one distinct knot using the weighted mean of their y values, and the report states how many duplicates were merged.

Developer & Automation Access

Run it from the terminal

Same engine as this page, headless — via the gizza CLI:

gizza tool spline-smoother "x,y
1,2.1
2,3.9
3,6.2
4,7.8
5,10.3
6,11.7"

New to the CLI? Get gizza →

Open it by URL

Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:

https://gizza.ai/tools/spline-smoother/?input=x%2Cy%0A1%2C2.1%0A2%2C3.9%0A3%2C6.2%0A4%2C7.8%0A5%2C10.3%0A6%2C11.7&mode=auto&smoothing=0.99&lambda=1&df=5&criterion=gcv&weights=1%2C%201%2C%202%2C%201%2C%201%2C%201&predict_at=1.5%2C%203.5%2C%205.5&resample=0&coefficients=true&output=json

Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.