Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use an SVG <path> with the C command to draw a cubic Bézier curve. The command takes six values: the x and y coordinates of two control points, followed by the x and y coordinates of the endpoint. For example, M20 130 C80 10 210 10 280 130 draws a curve from (20, 130) to (280, 130).

Draw a cubic Bézier curve with an SVG path

Place the path inside an inline <svg> element. This example includes a viewBox to establish its coordinate system and an accessible label for the graphic:

<svg viewBox="0 0 300 160" role="img" aria-label="A cubic Bézier curve">
  <path d="M20 130 C80 10 210 10 280 130" fill="none" stroke="currentColor" stroke-width="4" />
</svg>

The d attribute contains the path commands. M20 130 moves the current point to (20, 130). The following C command draws one cubic segment. Set fill="none" and specify a stroke to make an open curve visible; an open path with the default fill can otherwise look absent or confusing.

What the six numbers after C mean

The general form is C x1 y1, x2 y2, x y. The first pair gives the first control point, the second pair gives the second control point, and the final pair gives the endpoint. In the example, those points are (80, 10), (210, 10), and (280, 130), respectively.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The first control point influences the tangent as the curve leaves its start.
  • The second control point influences the tangent as the curve approaches its endpoint.
  • Control points pull the curve toward their positions, but do not need to lie on the curve.

SVG paths describe geometry with commands such as move, line, curve, arc, and closepath, as specified by the W3C SVG Paths specification.

Choose absolute C or relative c coordinates

Uppercase C uses absolute coordinates in the SVG user coordinate system. Lowercase c uses offsets from the current point. After a segment, its endpoint becomes the current point, so the next relative segment starts there.

These two examples draw the same two-segment curve:

<path d="M20 130 C80 10 120 10 150 80 C180 150 220 150 280 30"
      fill="none" stroke="teal" stroke-width="4" />
<path d="M20 130 c60 -120 100 -120 130 -50 c30 70 70 70 60 -50"
      fill="none" stroke="tomato" stroke-width="4" />

Each C or c can be followed by another group of six values to add a segment. Absolute coordinates make each point’s location explicit; relative offsets can be convenient when moving or translating a shape.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use S to continue a cubic curve smoothly

The shorthand command S x2 y2 x y supplies the second control point and endpoint, while SVG infers the first control point. If the preceding command is C, c, S, or s, the inferred point is the reflection of the previous segment’s second control point across the current point. If there is no eligible preceding cubic command, the inferred first control point is the current point.

<path d="M20 130 C80 10 120 10 150 80 S220 150 280 30"
      fill="none" stroke="purple" stroke-width="4" />

Here the first segment ends at (150, 80). The S command gives the next segment’s second control point, (220, 150), and endpoint, (280, 30). SVG reflects the prior second control point to infer the next first control point. This maintains tangent continuity when that reflected handle is appropriate. Use C when you need to choose the first control point explicitly; use S when the reflected handle gives the continuation you want.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Inspect handles and fix curves that look wrong

Temporary guides can make a path easier to adjust: draw thin lines from the start to the first control point and from the endpoint to the second control point, then mark the points with circles. Remove or hide the guides in the finished graphic.

  • Curve is clipped: check that the path coordinates fit inside the SVG’s viewBox.
  • Curve is unexpectedly scaled or positioned: confirm that you are interpreting coordinates in the intended viewBox user coordinate system.
  • Open path appears missing: set fill="none" and give it a visible stroke.
  • Join between segments looks wrong: inspect the control handles. With S, the inferred handle is a reflection; switch to C if you need to set that handle yourself.

For more command context, MDN explains that SVG <path> elements provide cubic curves with C and quadratic curves with Q in its SVG paths tutorial.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.