Same angles, two directions: both use 0 to Math.PI / 2.
Blue uses false (default clockwise) — short quarter down.
Red uses true — the long way the other direction.
Call beginPath() twice so the strokes stay separate.
Edge Cases & Pitfalls
Most blank arcs come from missing stroke/fill, wrong units, or path state.
units
Radians, not degrees
Passing 90 means ~14 full turns, not 90°. Multiply by Math.PI / 180.
path
Always beginPath() for separate shapes
Without it, arcs connect to previous path points and can look like unexpected lines.
radius
Radius must be positive
Zero draws nothing useful. Negative radius is invalid and may throw IndexSizeError.
paint
arc() alone is invisible
It only updates the path. You must stroke() or fill() afterward.
related
arcTo() is not the same
arcTo() rounds a corner between two lines. Use arc() when you know a center and radius.
Compatibility
Browser Support
ctx.arc() is part of the Canvas 2D API in every modern browser.
✓ Baseline · Widely available
arc()
Widely available since about July 2015. Chrome, Firefox, Safari, Edge, and Opera support circular arcs and full circles. Internet Explorer 9+ also supports arc().
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
ctx.arc()Widely supported
Bottom line: Safe to use for circles, arcs, and pie charts everywhere modern Canvas 2D runs.
Remember
Key Takeaways
Role:arc() adds a circular path; stroke()/fill() paint it.
Circle:0 to 2 * Math.PI with a positive radius.
Angles: radians from the positive x-axis; convert degrees when needed.
Direction: sixth argument true draws counter-clockwise.
One line:beginPath() → arc(...) → stroke() or fill().
UA style
Default CSS Settings
Drawing arcs 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 arcs.
Frequently Asked Questions
arc() adds a circular arc (or a full circle) to the current path. You still need stroke() or fill() to paint it on the canvas.
No — they are radians, measured from the positive x-axis. Convert with degrees * (Math.PI / 180).
Use startAngle 0 and endAngle 2 * Math.PI (a full turn). Then call stroke() or fill().
If true, the arc travels counter-clockwise from start to end. If false (default), it travels clockwise.
Common causes: forgetting beginPath(), not calling stroke() or fill(), radius of 0, or identical start and end angles for a tiny slice.
arc() draws around a center with a radius. arcTo() creates a rounded corner between two tangent lines — useful for smooth path joins.