SVG Paths: Curves and Arcs

The real power of the path element comes from its curve commands. These allow you to draw smooth, organic shapes that are impossible to create with straight-line elements alone.

Bezier Curves

SVG supports two types of Bezier curves. Both are defined using control points. These are invisible handles that pull the curve in a particular direction, like a magnet.

Cubic Bezier Curve: C

The C command uses two control points to give each end of the curve an independent handle:

C x1 y1, x2 y2, x y

The shorthand version S continues a curve from the last C, automatically reflecting the previous second control point.

Quadratic Bezier Curve: Q

The Q command uses one shared control point, making it simpler but less flexible:

Q x1 y1, x y

Example: Cubic and Quadratic Curves

Here both curve types are compared side by side. The small dots indicate the positions of the control points:

View Output

Elliptical Arcs: A

The arc command A draws a portion of an ellipse between two points. It's perfect for pie charts, rounded corners, and speech bubble tails. The syntax is:

A rx ry x-rotation large-arc-flag sweep-flag x y

Example: A Half-Circle and a Pie Slice

View Output

The Half-Circle (Lavender Arc)

The lavender arc acts as the "top" element in this composition:

The Pie Slice (Coral Wedge)

The coral slice is the "bottom" element: