Toolkitbar

SVG Shape Generator — Draw a Closed Bézier Shape, Get the SVG

Several Bézier segments, closed into one shape, out as SVG.

Options

Shapes

Curve degree

Area 45%

Random shape

Import an existing path

The maths of the selected segment

B(t) = (1−t)³P₀ + 3(1−t)²t·P₁ + 3(1−t)t²·P₂ + t³P₃

P₀
(50, 14)
P₁
(70, 16)
P₂
(94, 54)
P₃
(86, 74)
B(0.50)
(78.5, 37.25)
B′(0.50)
(45, 73.5)
Arc length
≈ 76.66
Selected point

Draw the shape

P₀P₁P₂P₃P₀P₁P₂P₃
3 points

Runs on your device What you paste is processed by your own browser. It is never sent to a server, and it is not stored anywhere after you leave the page.

Short answer

A shape made of several cubic Bézier curves can be drawn for free in a web browser with the gestures of a pen tool: click for a corner point, press and drag for a smooth curve, click the first point to close the outline. Each point has two handles that stay mirrored while it is smooth and can be broken apart with Alt to make a corner, so a shape can mix curves and hard angles. Closing joins the last point back to the first with Z, turning the segments into one shape. A drawing holds as many paths as it needs, each with its own fill, stroke and width, and a path marked as a hole is punched out of the one above it with the even-odd rule — which is how a ring is drawn, and the output is a complete <svg> element on a viewBox of 100, 200, 500 or 1000 units, with the <path>, the bare d attribute and a CSS clip-path as alternatives. Eight ready-made shapes — heart, star, drop, leaf, cloud, speech bubble, blob and wave — are there to start from, an existing d attribute can be pasted in to edit, segments can be cubic, quartic or quintic, and the selected segment's four control points, B(t), tangent and arc length are shown with a t slider that drives the de Casteljau construction on the canvas.

At a glance

AcceptsNothing to paste — the shape is drawn
ProducesA complete <svg>, or a <path>, d attribute or clip-path
ProcessingIn your browser
PriceFree, no limits
AccountNot required

Hand-writing a C command is the kind of thing nobody does twice. The letters are easy enough — M to move, C with two control points and an end point, Z to close — but the numbers are a guess until the browser draws them, which turns one blob into a dozen reload-and-nudge cycles.

So this draws it instead. The outline is closed and filled by default, because a run of Bézier segments joined into one shape is what most of this is for: a blob behind a hero section, an organic divider, a custom clip-path, an icon that is one curve rather than twelve rectangles. The square shows the fill as you drag, so you are shaping the shape rather than a wireframe of it.

The data stays honest in both directions: what is on the square is exactly the path in the output, held as fractions of the square and scaled onto whichever viewBox you ask for. Pick 1000 and the same shape comes back with three more digits of resolution, not a different shape.

The gestures are a pen tool's, deliberately: click for a corner, drag for a curve, Alt to break a smooth point, double-click a line to insert a point, click the first point to close. Those have been the same since Illustrator 88, which makes them worth copying rather than improving on — anyone who has drawn a vector already knows them, and every tutorial on the internet describes them.

Inserting a point splits the segment by de Casteljau's construction, so the curve does not move while you add somewhere to grab it. That is the difference between adjusting a shape and fighting it.

How to use it

  1. 1

    Click, or click and drag

    A click adds a corner point; pressing and dragging adds a smooth one with its handles already pulled out. Or pick one of the eight ready-made shapes, or paste an existing d attribute into the import box and edit that.

  2. 2

    Shape it

    Drag a point to move it, drag a handle to bend the curve, hold Alt to break a smooth point into a corner. Double-click a point to switch corner and smooth; double-click a line to insert a point there. Arrow keys nudge, Ctrl+Z undoes.

  3. 3

    Close it and fill it

    Closed joins the last point back to the first with Z; the fill setting decides whether the shape comes out filled, outlined, or both.

  4. 4

    Copy or download the SVG

    The default output is a complete <svg> element — copy it, or download it as an .svg file.

Frequently asked questions

What do M, C and Z mean in the output?

M moves the pen to the start without drawing. C draws a cubic Bézier: two control points followed by the end point. Z closes the path back to where M put the pen, which is what makes the segments one shape rather than a line that happens to end near its start. Those three are the whole of what this page emits.

How many curves can one shape have?

As many as you place points. Every point after the first adds a C segment, and closing adds one more to get back to the start — so a four-point closed shape is four Bézier curves in a single d attribute, and a twelve-point one is twelve.

Why fill a shape rather than stroke it?

Because a closed outline is a region, and most uses want the region: a background blob, a divider, an icon, a clip-path. Outline-only is there for the cases that want the line itself. Note that SVG will fill an open path too, by pretending it is closed — which is almost never what you meant, so close it deliberately.

What is the difference between a corner point and a smooth point?

A smooth point keeps its two handles on one line and the same length, so the curve passes through without a kink. A corner point has independent handles — or none at all, which makes the segments either side of it straight lines. Click adds a corner, drag adds a smooth point, double-click switches between them, and holding Alt while dragging a handle breaks a smooth point apart.

Can I start from an existing shape?

Yes — a heart, star, drop, leaf, cloud, speech bubble, blob or wave, each one a real editable path rather than a picture. Every point and handle is yours to drag afterwards, and each preset brings its own closing and fill, because an open wave and a filled heart are not the same kind of thing.

Can I undo a mistake?

Yes. Undo and Redo cover every edit — moving a point, bending a handle, inserting, deleting, applying a preset — and Ctrl+Z and Ctrl+Shift+Z work while the canvas has focus. Delete removes the selected point.

Can I edit an SVG path I already have?

Yes. Paste the contents of its d attribute into the import box. Every command in the grammar is read — M L H V C S Q T A Z, absolute or relative, with implicit repeats — quadratics become cubics exactly, the smooth shorthands get their reflected control point, and elliptical arcs are converted to cubics. A path with several subpaths keeps the first and says so, because this editor holds one path. The shape is scaled to fit the square, so the box it was authored in is not preserved; the shape is.

What is the curve degree for?

A degree-n segment has n+1 control points, so a higher degree lets one span bend further without adding another point to it — a quartic has one interior control point, a quintic two, drawn as diamonds. Raising the degree is exact: a cubic is also a quartic, so the shape does not move and you simply gain a handle. Lowering cannot be exact, because most quartics are not cubics, so the editor says how far the shape moved. SVG has only cubics, so a higher-degree segment is exported as several cubic pieces, split until they match the real curve to within a tenth of an output unit — closer than the numbers are printed to.

Can one drawing have several shapes, or a hole?

Yes to both. The path list holds as many paths as you add, each with its own closed flag, fill, stroke colour and stroke width, and each exported as its own <path>. Marking a path as a hole is what makes a ring: it joins the path above it as a second subpath and the pair is filled with fill-rule="evenodd", so the inner outline takes the fill away again rather than drawing a smaller shape on top. The ready-made ring is two paths doing exactly that.

What does the maths panel show?

Everything about the segment leaving the selected point: its four control points in the output's units, the polynomial B(t) = (1−t)³P₀ + 3(1−t)²t·P₁ + 3(1−t)t²·P₂ + t³P₃ that they are the coefficients of, the point and the tangent vector at the t on the slider, and the arc length. Ticking the box draws de Casteljau's construction on the canvas: interpolate along each chord between the control points, then along the chords between those, and the point on the last one is B(t). That construction is also what splits a segment when you insert a point, which is why inserting does not move the curve.

What does the viewBox size change?

Only the numbers. The drawing is held as fractions of the square, so a larger viewBox is the same shape with more precision — useful when the shape will be scaled up, or when you want to avoid decimals in the output.

Can I use it as a CSS clip-path?

Yes, that is one of the output options: clip-path: path('…'), with the same d string. Both clip-path and offset-path read the data in CSS pixels rather than in your viewBox, so pick the size to match the element you are clipping — a 100-unit shape clips a 100px box.

Why are the fill and stroke currentColor?

So that a shape pasted into a page inherits the colour of the text around it instead of arriving as hard-coded black, which is invisible on a dark background. Change either to any value you like once it is in your own markup.

Related tools

Browse all developer tools →