# Bézier Curve Fitter for SVG Paths > Turn jagged traced outlines or freehand polylines into a few smooth Bézier curves. Paste SVG path data from a tracer, a drawing tablet or a plotter export. The fitter replaces runs of short segments with cubic Bézier curves and straight lines, keeps sharp corners, and proves that the new path stays within your tolerance of the original in both directions. Pixel mode treats the path as pixel steps (as traced by Lumina Vector Lab) and smooths the stairs; freehand mode follows every point. Lumina Vector Lab uses the same engine for curve smoothing. Part of usefulweb.app (https://usefulweb.app/). Part of [Lumina](https://lumina.usefulweb.app/) (ownerApp: lumina). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://luminacurvefit.usefulweb.app/ (interactive tool at https://luminacurvefit.usefulweb.app/tool) - JSON API: POST https://luminacurvefit.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://luminacurvefit.usefulweb.app/api/v1/tool) - OpenAPI: https://luminacurvefit.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://luminacurvefit.usefulweb.app/mcp - tool `lumina_curve_fit` ## Inputs - path (textarea, required): SVG path data (d attribute) - mode (select): Input kind - tolerance (number): Maximum distance from the input (path units) - cornerAngle (number): Keep corners sharper than (degrees) - precision (integer): Decimals in the result ## Method - Path data is read with the full SVG grammar; curves and arcs in the input are flattened to within a tenth of the tolerance first. Every sub-path is fitted separately: closed ones as loops, open ones with both end points kept. - Corners are vertices whose direction changes by more than the corner angle, measured over a short window (3 × tolerance, 2 units for pixel outlines); they stay sharp and split the path into runs. - Each run is fitted with least-squares cubic Béziers (chord-length parameters, Newton reparameterisation, split at the worst point with a shared tangent). Pixel mode first samples the stairs every half unit and filters the samples (twelve [1 2 1] passes) so the fit follows the smooth shape behind the steps. - A curve or line is accepted only with a proven two-sided distance bound to the input run: the curve is flattened with a convex-hull error bound, both polylines are sampled every tolerance / 10, and the bound adds both errors and half the sampling step. Runs that cannot be fitted keep their original segments. Rounding to the chosen decimals is reserved inside the tolerance. ## Limits - The fitted path stays within the tolerance of the input (after any input curves were flattened to a tenth of it). Fitting does not check whether different sub-paths now touch each other; Lumina Vector Lab adds that check for traced artwork. Up to 200,000 characters, 2,000 sub-paths and 20,000 points.