Toolstia / CSS clip-path generator

CSS clip-path generator

Cut an element into a shape with the CSS clip-path property. Pick a preset such as a hexagon, star, arrow or speech bubble, edit the polygon points, or switch to a circle, ellipse or rounded rectangle. The preview updates as you type.

clip-path hides everything outside the shape. Each polygon point is an x and y position measured from the top left of the element.

How it works

  1. Choose a shape.
  2. Edit the points if you want a custom polygon.
  3. Copy the CSS.

Polygon points

Each point is an x and y position measured from the top left of the element. Percentages scale with the element, so the shape stays in proportion.

Other shapes

Circle, ellipse and inset (with optional rounded corners) are built in. Inset is a handy way to crop an image.

Custom shapes

Type your own points, one pair per line or separated by commas. Use percent or pixel values, and at least three points.

What clip-path does

Everything outside the shape is hidden, including clicks. The element still takes up its original space in the layout.

Questions

Does it work in all browsers?

Yes, clip-path with these shapes works in all current browsers. Everything happens in your browser, and nothing you enter is sent anywhere.

Can I animate it?

Yes. Two polygons with the same number of points can be transitioned smoothly.

Why are the shape edges sharp?

Clip paths are not anti-aliased in some browsers at small sizes. A drop-shadow filter on a parent is a common fix for shadows.