Skip to content

Masks an element to a shape you drag out, leaving its box intact so the layout around it never shifts.

Triangle
Width: 400px
    Height: 400px
      Image is loading...
      CSS Code
      clip-path: polygon(50% 0%, 100% 100%, 0% 100%);

      What is Online CSS Clip Path Generator?

      CSS Clip Path Generator is a free online tool for generating CSS clip path for masking your images. "clip-path" is a CSS property for restricting the boundaries of an image by predefined rules. It gives you flexibility to obtain image masks just by using CSS. You can obtain image background transparency with JPG file type partially with this feature without using PNG and make an indirect image optimization.

      There are 4 different clip-path types, polygon, circle, ellipse and inset. Most widely used CSS clip-path type is polygon. You can put as much dots as you want to obtain a polygon and this shape will be used as a reference to you image mask. There are many geometric polygon shapes are available in the tool to use as a template to obtain the desired clip-path. They are varying from simple geometric shapes to more complex structures.

      CSS clip-path property can be used for different purposes. It is mostly used in landing page and hero images as image mask. We can say that it works as a CSS shapes generator. It is not mendatory to use an image as background. You can use css clip-path property with solid backgrounds or backgrounds with gradients. Also, you can use clip-path to shape your section separators. It is a common trick to use CSS clip-path to obtain diagonal section separators. It is better to use SVG mask for complex shapes like waves, curves, etc., but online CSS Clip Path Generator will be suffucient if the shape is simple.

      Here is an artistic image that is clipped with CSS clip-path. It looks more aesthetic than the raw image in your UI (user interface) design and webpages for most cases and it's a relatively low-cost operation.

      Clipped image with rhombus-shaped CSS clip-path
      Clipped image with rhombus-shaped CSS clip-path

      How to use Online CSS Clip Path Generator?

      You can generate CSS clip-path code with the help of the instructions below.

      1. Select the shape you want to use as a template for your clip-path.
      2. You can either use placeholder images or your own background image by setting its URL.
      3. You can change the width and height of the preview image. Be careful, since clip-path coordinates are given in percentage, aspect ratio of the image is more important than the width and the height.
      4. Move the dots to change the path as you need by dragging them. When you get the desired result, you can use "Hide the guides" option to see the final result.
      5. If you get the desired clip-path, you can copy the CSS code to your clipboard and paste into your web project.

      Frequently asked questions

      What does clip-path actually do?

      It hides everything outside a shape you define. The element is still there at its full size — the browser simply stops painting the parts that fall outside the path, which is why layout around it does not shift.

      Why use it instead of a cut-out PNG?

      Because the image stays a rectangle you can swap, and the mask stays a line of CSS you can animate or change at a breakpoint. A pre-cut PNG locks the shape into the file and costs you transparency overhead on every load.

      Will it work in every browser?

      Basic shapes and polygons are supported everywhere that matters now. More exotic uses, particularly referencing an external SVG path, are patchier — worth a check if you support older browsers.

      Can clip-path be animated?

      Yes, as long as the start and end paths have the same number of points. Polygons with mismatched point counts jump rather than morph, which is the usual reason an animation looks broken.

      What if I want a soft edge instead of a hard one?

      clip-path cuts cleanly by design. For something softer, a gradient or a shadow is the better tool — the CSS Gradient Generator and CSS Box Shadow Generator cover those.

      Credits

      Images used under the clip path for preview purposes are served by unsplash.com.