On an <canvas>, ctx.bezierCurveTo() adds a cubic Bézier curve to the current path. You give two control points and an end point. The start is the current path point (set with moveTo() or a previous segment).
Control points pull the curve but are not drawn automatically. After building the path, call stroke() or fill(). For a simpler one-control-point bend, use quadraticCurveTo().
Baseline · Widely available.
CanvasRenderingContext2D.bezierCurveTo() is a stable Canvas 2D method across modern browsers since about July 2015.
Cubic vs quadratic.
Cubic = two control points (bezierCurveTo). Quadratic = one control point (quadraticCurveTo). Prefer quadratic when one handle is enough.
Second curve’s cp1 mirrors that handle past mid for a smoother tangent.
Stroke once so the join looks like one continuous line.
Edge Cases & Pitfalls
Most Bezier bugs come from a missing start point or confusing control points with the curve itself.
start
Set a start with moveTo()
Without a current point, the curve may start at (0, 0) or look wrong. Always moveTo first for a standalone curve.
controls
Control points are not on the curve
They only pull the path. Draw helper dots if you need to debug the handles.
paint
bezierCurveTo() alone is invisible
It updates the path only. Call stroke() or fill() afterward.
choice
Prefer quadratic when one handle is enough
quadraticCurveTo() is simpler for gentle bends. Use cubic for S-shapes and finer control.
joins
Sharp corners at joins
If chained curves look kinked, mirror the control points around the join so tangents line up.
Compatibility
Browser Support
ctx.bezierCurveTo() is part of the Canvas 2D API in every modern browser.
✓ Baseline · Widely available
bezierCurveTo()
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support cubic Bézier curves. Internet Explorer 9+ also supports bezierCurveTo().
98%Global support (approx.)
Google ChromeAll modern
Full support
Mozilla FirefoxAll modern
Full support
Apple SafariAll modern
Full support
Microsoft EdgeAll modern
Full support
OperaAll modern
Full support
Samsung InternetAll modern
Full support
Internet Explorer9+
Supported
bezierCurveTo()Widely supported
Bottom line: Safe to use for icons, smooth UI paths, and illustration-style curves on Canvas 2D.
Remember
Key Takeaways
Role: cubic curve = start + two control points + end.
Start: use moveTo() before the first bezierCurveTo().
Chain: the next curve continues from the previous end point.
Simpler option: one handle → quadraticCurveTo().
One line:moveTo → bezierCurveTo(cp1, cp2, end) → stroke() / fill().
UA style
Default CSS Settings
Bézier drawing is a Canvas API concern. The <canvas> element still uses typical user-agent CSS:
default.css
canvas {
display: inline;
}
Set bitmap size with HTML width/height. CSS-only sizing scales the bitmap and can blur curves.
Frequently Asked Questions
It adds a cubic Bézier curve to the current path using two control points and an end point. The start is the current path point (often set with moveTo()).
quadraticCurveTo() uses one control point (simpler bends). bezierCurveTo() uses two control points, so you can shape S-curves and more complex bends.
Common causes: forgetting moveTo() for the start, not calling stroke() or fill(), or placing both control points on the line between start and end.
No. Control points pull the curve but are not drawn unless you draw them yourself (for example with small arcs).
Yes. Each bezierCurveTo() starts from the previous end point. Call beginPath() when you want a separate shape.
Both refer to the same curve family. In code the method is bezierCurveTo (ASCII). Docs often write Bézier.