CSS Clip-Path Polygon Generator & Visual Editor
Start from a shape preset, drag the points or type their X and Y percentages, and copy the generated clip-path. The preview applies the same declarations you copy.
Runs locally in your browserStart from a shape preset, drag the points or type their X and Y percentages, and copy the generated clip-path. The preview applies the same declarations you copy.
Runs locally in your browserThe editor works on one polygon() shape and writes the two declarations a stylesheet needs: the prefixed -webkit-clip-path line and the standard clip-path line. Five presets cover the common shapes — Triangle with 3 points, Diamond with 4, Hexagon with 6 (the default), Star with 10 and Chevron with 6 — and every point can be moved by dragging its handle on the board or by typing an X and Y percentage.
The stage is a live preview of that same CSS: the polygon is applied to the preview element while you drag, and the readout in its header counts the points. The coordinates are percentages of the element’s own box, so a shape keeps its proportions when it is applied to an element of a different size.
The block holds one rule: .clipped-element with a -webkit-clip-path line and a clip-path line, both carrying the same polygon() value built from comma-separated x y percentage pairs. Nothing else is written — no prefix beyond -webkit-, no CSS custom properties and no selector for your own markup, so rename .clipped-element to the class you actually use.
The pairs are percentages of the reference box, which is the border box for an element that does not override it. The shape therefore scales with the element and does not depend on the pixel size of the preview board.
The preview shows what the browser you are using does with the value; the page carries no compatibility table and does not detect support. Basic polygon() clipping works in current Chrome, Edge, Firefox and Safari, and the -webkit- line keeps older iOS and Safari builds working, but check the engines your audience uses before the shape carries meaning — a browser without support paints the whole box.
The clip is not only visual: a click outside the polygon does not land on the element, which matters when the clipped element is a link or a button and its target area has to match what is on screen.
A polygon needs three points and accepts twelve. Add point splits the edge after the active point, Remove point deletes the active one, and the status line reports both limits in the language of the page. The Active point list follows creation order, which is also the order of the pairs inside polygon().
Everything runs inside the page: the shape is computed by the browser, no value is uploaded, and the tool keeps working with the network disconnected. The preview element is styled with the declaration the code panel shows, so there is no second implementation that could disagree with the CSS you copy.