Free Online CSS clip-path Generator with a Polygon Editor
Build a clip-path by dragging points over the preview. Click to add a point, double click to remove one, and read the coordinates in per cent as you go. Inset with its own radius, circle and ellipse are here too, along with ready-made triangles, hexagons, stars, arrows and chevrons.
Drag a point to move it. Click anywhere else inside the frame to add one. Double click a point to remove it.
Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.
Keeping the shadow when you clip
The shadow belongs on a wrapper, as a filter, not on the clipped element.
A clipped element has no box left to cast a shadow from, so
box-shadow on it is thrown away along with everything else outside the path. The
fix is to put the shadow on a parent as a filter: drop-shadow(), because that
filter follows the actual painted pixels rather than the border box:
.clip-outer{
filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .35));
}
.clip-inner{
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
The same trick is the only way to get a border-like
outline on a clipped shape: stack a slightly larger clipped element behind it in the border
colour, since border on the clipped element is clipped too. Both of these are
wrapper-level changes, so they are not part of the single rule this page outputs.
How to Build a CSS clip-path
A few steps, and nothing is uploaded.
What to Know About clip-path
Including why your box-shadow vanishes the moment you clip.
box-shadow on a clipped element disappears completely, because the shadow is painted outside the border box and the clip throws away everything outside the path. The fix is filter: drop-shadow() on a wrapper element, which follows the visible pixels instead of the box. The section above has the exact pattern.
polygon() the first number of each pair is a per cent of the width and the second is a per cent of the height, so a shape built at one aspect ratio will skew at another. If you need a shape that keeps its proportions, give the element a fixed aspect-ratio or use pixel units in the path.
Key Features & Capabilities
What this tool does, and what it deliberately does not.
About the CSS clip-path Generator
clip-path hides everything outside a shape you describe. It is how diagonal section dividers, angled cards, hexagon avatars and arrow-shaped breadcrumbs are built now, and it replaced a long list of tricks involving rotated pseudo-elements and overflow hidden. The syntax is simple enough to read but almost impossible to write blind, because a polygon is just a list of coordinate pairs and no one can hold eight of those in their head at once.
That is why the polygon editor is the centre of this page rather than a feature of it. The points are drawn over the preview and are draggable, so you position the shape by eye and the coordinates follow. Clicking inside the frame inserts a new point on the edge nearest the click, rather than at the end of the list, because appending a point to a polygon almost always produces a crossed path. Double clicking a point removes it, and the same values are available as number fields for the times when you want exactly 33 per cent.
The preview sits on a checker board so you can see what has been clipped away rather than guessing at where the shape ends. The things the page does not do are worth stating: it writes a rule and never reads one, it uses per cent only, and it does not know about path(), SVG references, or multiple subpaths. What it does cover is the part people get stuck on, which is turning a shape in your head into a list of numbers.
Frequently Asked Questions
Winding, per cent units, shadows, borders and hit testing.
filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)) instead. That filter traces the visible pixels, so it follows the clipped shape properly, and it is the standard answer to this problem.shape-outside on a floated element, which is a different property with different rules. Clipping is purely about what gets painted.polygon() are resolved per axis: the first value against the width, the second against the height. A 45 degree cut at one aspect ratio becomes a shallower or steeper cut at another. Set an aspect-ratio on the element, or switch those coordinates to pixels, if the angle needs to stay constant.