On an <canvas>, ctx.quadraticCurveTo() adds a quadratic Bézier curve to the current path. You give one control point and an end point. The start is the current path point (set with moveTo() or a previous segment).
One control point is enough for gentle arches and speech-bubble corners. For S-curves or independent start/end handles, use bezierCurveTo() (two control points).
Baseline · Widely available.
CanvasRenderingContext2D.quadraticCurveTo() is a stable Canvas 2D method across modern browsers since about July 2015.
Quadratic vs cubic.
Quadratic = one control point (quadraticCurveTo). Cubic = two control points (bezierCurveTo). Start with quadratic when learning curves.
Next calls continue from that end — no extra moveTo.
One stroke() paints the whole connected path.
Example 4 — Soft Rounded Shape
Use four quadratics to round a speech-bubble style box.
HTML
<canvas id="demo" width="300" height="160" aria-label="Rounded bubble outline"></canvas>
<script>
const ctx = document.getElementById("demo").getContext("2d");
const x = 40, y = 40, w = 220, h = 80, r = 20;
ctx.beginPath();
ctx.moveTo(x + r, y);
ctx.lineTo(x + w - r, y);
ctx.quadraticCurveTo(x + w, y, x + w, y + r);
ctx.lineTo(x + w, y + h - r);
ctx.quadraticCurveTo(x + w, y + h, x + w - r, y + h);
ctx.lineTo(x + r, y + h);
ctx.quadraticCurveTo(x, y + h, x, y + h - r);
ctx.lineTo(x, y + r);
ctx.quadraticCurveTo(x, y, x + r, y);
ctx.closePath();
ctx.strokeStyle = "#7c3aed";
ctx.lineWidth = 3;
ctx.stroke();
</script>
Most quadratic bugs come from a missing start point or placing the control on the chord.
start
Set a start with moveTo()
Without a current point, the curve may start at (0, 0). Always moveTo for a standalone curve.
control
The control point is usually not on the curve
It only pulls the path. Draw a helper dot when debugging.
paint
quadraticCurveTo() alone is invisible
Call stroke() or fill() after building the path.
choice
Need an S-curve? Use cubic
One control cannot bend both ends independently. Switch to bezierCurveTo().
corners
Rounded rects: control at the corner
A common pattern puts the control at the sharp corner and ends on the next side, as in Example 4.
Compatibility
Browser Support
ctx.quadraticCurveTo() is part of the Canvas 2D API in every modern browser.
✓ Baseline · Widely available
quadraticCurveTo()
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support quadratic curves. Internet Explorer 9+ also supports quadraticCurveTo().
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
quadraticCurveTo()Widely supported
Bottom line: Safe to use for rounded UI shapes, simple arches, and learning curves before cubic Beziers.
Remember
Key Takeaways
Role: quadratic = start + one control point + end.
Start: use moveTo() before the first curve.
Chain: the next curve continues from the previous end.
Upgrade: need two handles → bezierCurveTo().
One line:moveTo → quadraticCurveTo(cp, end) → stroke() / fill().
UA style
Default CSS Settings
Quadratic 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 quadratic Bézier curve to the current path using one control point 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 for S-curves and finer shaping.
If the control point lies on the line between start and end, the curve looks straight. Move the control point off that line to bend it.
No. The control point pulls the curve but is not drawn unless you draw it yourself (for example with a small arc).
Yes. Each quadraticCurveTo() starts from the previous end point. Call beginPath() when you want a separate shape.
Use quadratic when one handle is enough. Switch to cubic (bezierCurveTo) when you need independent pull near the start and end.