CSS Clip-Path Generator

Build CSS clip-path shapes visually. Drag polygon points, load presets, or type circle, ellipse and inset values, with a live preview and copy-ready CSS.

🌐 Español

Shape presets

Drag a point on the preview above, or edit its exact position here.

Point 1
Point 2
Point 3

🔒 Private by design: everything runs locally in your browser and never uploaded to any server.

Four shape functions and what each one is for

clip-path removes everything outside a shape you define. What is left is not merely hidden: the clipped area stops rendering and stops receiving pointer events, so a link clipped to a circle genuinely cannot be clicked outside that circle. That is the real difference between it and overflow: hidden.

Four buttons under the preview switch between the four shape functions it writes:

Dragging a handle beats picturing a percentage grid

Hand-writing polygon(50% 0%, 0% 100%, 100% 100%) means holding a percentage grid in your head and running an edit-save-refresh loop until it looks right. This builder inverts that.

  1. Pick a mode: Polygon, Circle, Ellipse or Inset.
  2. In Polygon mode, drag a handle on the preview, or start from one of the Shape presets buttons.
  3. Type exact figures into the X % and Y % fields under the preview when a drag is not precise enough.
  4. Click Copy CSS to take the declaration out of the box.

Circle and Ellipse each expose one draggable handle, their centre; their radii are typed. Polygon exposes a handle per point, plus + Add point, which drops the new point ten percent right of the last one so repeated clicks fan out instead of stacking, and a remove button per row that disables itself once three points are left, since a polygon needs three to enclose an area.

The output box holds a complete declaration, clip-path: ...;, rather than a bare value or a whole rule, so it drops straight into an existing selector.

Where the preset coordinates come from

Five presets sit under Shape presets in Polygon mode. Triangle is the simplest three-point shape there is: top centre, bottom left, bottom right. Arrow, Chevron and Message bubble were checked against published clip-path coordinate examples rather than written from memory, which matters because a chevron whose notch is a few percent off looks subtly wrong.

Star is the interesting one. It is generated rather than typed: ten vertices alternating between an outer and an inner radius every 36 degrees, starting straight up. The inner radius is the outer radius divided by the golden ratio squared, roughly 38.2 percent of it, which is the exact proportion of a real pentagram rather than an eyeballed approximation. One consequence you can check by looking at the point list: the top spike lands at exactly 50 percent across and 0 percent down, dead centre on the top edge. Every preset is a starting point rather than a lock: load one, then drag its points.

The clamps: radius to 150 percent, inset edges to 50

Polygon point coordinates and the circle and ellipse centres clamp to 0 to 100 percent, which is the box itself. Radii clamp to 0 to 150, deliberately allowed past 100 so a circle can extend beyond a corner of its element, which is what you want for a reveal animation originating off-shape. Inset edges and the corner rounding clamp to 0 to 50, because two opposite insets past 50 percent would already have clipped the element away to nothing. Every value that reaches the CSS is rounded to two decimal places, so a drag never produces a fourteen-digit float in your stylesheet.

Percentages resolve against the element you apply the declaration to, not against this preview. The preview box is a 3 by 2 rectangle, so the same polygon() on a square avatar reshapes to those proportions. If a shape has to hold its angles whatever it is applied to, pixel values are the unit you want.

Checking the crop against a real photo

A flat colour block tells you the outline. It does not tell you whether the crop takes someone’s chin off. The Sample image (optional) picker swaps the placeholder for one of your own images, which is the check that actually matters for a hero image, an avatar or a product thumbnail.

The file is turned into a local blob: URL and handed to the browser to display. This tool never reads its bytes, never re-encodes it and never transmits it, so there is no size limit here at all; the picker simply asks your operating system for image files. Remove image puts the placeholder back.

Nothing here is saved, so copy before you leave

There is no account, no server and no local storage behind this builder. The shape lives in the tab’s memory for as long as the tab is open; refresh or close it and you are back at the starting triangle with the default circle, ellipse and inset values. Take the declaration out with Copy CSS, which shows a manual-copy message if the browser refuses the clipboard, before you navigate away.

The neighbouring CSS builders tend to be the next stop: the CSS Gradient Generator for the fill behind the shape, the CSS Box Shadow Generator for depth, and the CSS Grid Generator for the layout around it. The rest sit on the generators hub.

See it in action

Screenshot of the CSS Clip-Path Generator tool with a shape editor with draggable points over a preview stage, the matching clip-path CSS below it, and a choice of starting shapes
CSS Clip-Path Generator mid-process: a shape editor with draggable points over a preview stage, the matching clip-path CSS below it, and a choice of starting shapes.
Diagram: where the work happens on a SysFenix page that has no file input at all: the tool arrives as ordinary JavaScript inside the page, works the answer out on your own device and renders it in place, so the upload, queue and server-side record a typical online tool needs never happen
Where the work happens on a SysFenix page that has no file input at all: the tool arrives as ordinary JavaScript inside the page, works the answer out on your own device and renders it in place, so the upload, queue and server-side record a typical online tool needs never happen.

Frequently asked questions

Does the generated CSS include a -webkit- prefix?

No. The box holds one unprefixed clip-path declaration. The prefixed form was only ever needed by browser versions long out of circulation, and emitting a prefix line automatically would push a stale property into everyone's stylesheet. If you specifically have to support an ancient engine, duplicate the line yourself with the prefix rather than shipping it by default.

Can I animate or transition between two clip-path shapes?

You can, with one condition CSS imposes rather than this tool. Two polygon values only interpolate smoothly when they list the same number of points in the same order, so build both states here with an equal point count and drag rather than add or remove. Change the count between the two states and the browser will swap abruptly instead of tweening. Circle and ellipse interpolate on their radii and centre without that restriction.

Does dragging work on a phone or tablet?

Yes. The handles are wired through Pointer Events, which covers touch and stylus input as well as a mouse. The honest caveat is that a fingertip is much wider than a handle, so on a small screen precise placement is easier through the X % and Y % number fields under the preview. Those fields behave identically on any device and clamp to the same range dragging does.

My shape looks different on the real element than in the preview. Why?

Almost always because the element has a different aspect ratio. Coordinates are percentages of the element's own width and height, so the preview's 3 by 2 box and a square avatar will not produce identical angles from the same polygon. Either match the aspect ratio, or use fixed pixel units in the shape function if the geometry has to hold exactly whatever the element does.

If I switch to Circle and back to Polygon, do I lose my points?

No. Each mode keeps its own values and only the active mode is written to the CSS box, so switching between the four is free and reversible. Clicking a shape preset is the one action that overwrites the polygon point list, because a preset simply is a point list. Reloading the page is the other way to lose your work, since nothing is stored.

Can the same declaration clip an image and a plain div?

Yes. clip-path applies to any element, which is exactly why the sample-image picker exists. The preview clips a plain coloured block by default and clips your own photo when you supply one, using the identical declaration in both cases, so what you see against a photograph is what a real image element will do with it.

Related tools