Clip Path Generator

Create modern CSS shapes for images and containers.

What Is a CSS Clip Path Generator?

A CSS clip path generator is a visual tool that lets you create non-rectangular shapes for HTML elements without writing coordinate math by hand. The clip-path property in CSS defines a clipping region — anything outside that region becomes invisible, effectively masking the element into circles, polygons, ellipses, or any custom shape you define. This generator gives you a live preview of the result and outputs clean, copy-ready CSS so you can drop it straight into your project.

Unlike traditional approaches that rely on transparent PNGs or SVG masks, clip-path is pure CSS. It's resolution-independent, performant, and fully animatable — you can transition between shapes for hover effects and reveal animations. Most developers use it for circular profile images, angled hero sections, hexagonal thumbnail grids, and creative card layouts that break away from the standard rectangular grid. If you're used to rounding corners with border-radius, clip-path is the next step — it handles any shape, not just rounded rectangles.

This tool covers the four core clip-path functions: circle(), ellipse(), polygon(), and inset(). Select a preset, preview it instantly, and copy the generated CSS. For more complex visual layering — like frosted glass panels clipped into custom shapes — pair clip-path with the glassmorphism generator.

CSS Code


          

Popular Clip Path Shapes

Triangle

polygon(50% 0%, 0% 100%, 100% 100%)

A classic three-point shape perfect for directional pointers, play buttons, and decorative dividers.

Hexagon

polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%)

A six-sided shape commonly used for avatars, icons, and tech-themed UI elements.

Star

polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)

A five-pointed star ideal for ratings, featured highlights, and badge designs.

Blob Shapes

polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%)

Organic, curved-like polygon approximations that add fluid, modern aesthetics to backgrounds and containers.

Why I Built This Clip Path Generator

I used to keep a text file on my desktop with snippets like polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%) for a pentagon shape I liked. Every time I needed a hexagon or a chevron or an arrow, I'd either dig through that file or end up on MDN counting percentage coordinates on a mental grid. It was tedious, and I kept making small mistakes — a misplaced comma, an inverted Y axis — that would render the shape as a mangled triangle instead of what I wanted.

I built this generator to stop guessing. Click a preset, see the shape, copy the code. No mental math, no coordinate plotting. What surprised me was how much faster my workflow got for things I didn't even think of as "clip-path problems" — like angling the bottom edge of a hero section or making a team page with hexagonal avatar frames. Once you stop thinking of clip-path as advanced CSS and start treating it like any other visual property, it becomes one of the most useful tools in your toolkit.

It's deliberately simple. There are more advanced generators out there that let you drag vertices on a canvas, but for most of my projects I just need the common shapes with correct coordinates and copy-paste code. That's exactly what this does.

What Is CSS Clip Path?

The clip-path CSS property creates a clipping region that defines which part of an element is visible. Everything outside the defined region is hidden, effectively cutting the element into a specific shape — circles, polygons, ellipses, or complex custom forms. Unlike traditional masking techniques that rely on PNG images with transparency, clip-path is purely code-based, resolution-independent, and dynamically adjustable. The clipped area does not affect the document layout; the element still occupies its original rectangular space in the flow, but only the clipped portion is rendered visually.

Clip-path works on any HTML element — images, divs, videos, and canvases. This makes it an incredibly versatile tool for web design. You can mask a profile picture into a circle, cut a container into a hexagon, or shape a hero section with an angled bottom edge — all without modifying the underlying image or adding extra markup. The result is cleaner HTML, better performance, and easier maintainability compared to image-based masking.


Types of Clip Path Shapes

circle()

The circle() function clips an element into a perfect circle. It accepts a radius value and an optional center position. The syntax circle(50% at 50% 50%) creates a circle with a radius of 50% of the element's dimensions, centered exactly in the middle. This is the most common use case for circular profile images, avatar placeholders, and icon backgrounds. Because the radius is calculated relative to the element's bounding box, the circle automatically scales proportionally when the element is resized.


ellipse()

The ellipse() function creates an oval shape by accepting separate horizontal and vertical radius values. The syntax ellipse(25% 40% at 50% 50%) defines an ellipse that is 50% wide (25% radius on each side) and 80% tall (40% radius on each side), centered in the element. Ellipses are useful for creating pill-like shapes, panoramic image masks, and decorative elements where a pure circle feels too rigid. The ability to offset the center point with the at keyword allows for asymmetric oval shapes that can create dynamic visual tension.


polygon()

The polygon() function is the most flexible clip-path shape, defined by a series of coordinate pairs that represent the vertices of a multi-sided shape. Each pair is expressed as percentages of the element's width and height. For example, polygon(50% 0%, 0% 100%, 100% 100%) places the first point at the top-center, the second at the bottom-left, and the third at the bottom-right, forming a triangle. Polygons can have any number of vertices, enabling complex shapes like hexagons, stars, arrows, diamonds, and organic blob forms. The points are connected in order by straight lines, so the shape is always closed.


How Clip Path Works in CSS

The clip-path property accepts several types of values. Basic shape functions — circle(), ellipse(), polygon(), and inset() — define the clipping region using geometric parameters. The inset() function is particularly useful for creating rectangles with rounded corners that go beyond standard border-radius, as it allows individual corner clipping. You can also reference an SVG clipping path using url(#clipId), which enables arbitrarily complex curved shapes defined in SVG markup.

One important characteristic of clip-path is that it affects rendering but not layout. The element's box model — margins, padding, borders, and background — remains rectangular in the document flow. Interactions like hover states and click events only trigger within the visible clipped area in most browsers, which is useful for creating non-rectangular interactive buttons. Transitions and animations can be applied to clip-path, enabling smooth morphing effects between different shapes — for example, transitioning a square to a circle on hover.


How to Use This Clip Path Generator

This tool simplifies the process of creating clip-path CSS by providing a visual preview alongside ready-to-use code. Select a shape preset from the control panel — circle, ellipse, triangle, or hexagon — and the preview updates instantly to show how the shape looks applied to a gradient element. The corresponding CSS code is generated automatically below the preview. Click the copy button to transfer the code to your clipboard and paste it directly into your stylesheet. When styling clipped elements with gradients or background colors, generate color palettes that provide visually appealing combinations. For precise color adjustments in your CSS values, you can convert HEX to RGB to work with opacity and rgba formats. To develop a cohesive visual language across your clipped shapes and surrounding UI, learn color combinations that enhance the impact of masked elements.


Real Use Cases for Clip Path

Image masking is the most prevalent use case — replacing border-radius for circular avatars or creating polygon-shaped thumbnails for galleries and team pages. Creative UI cards use clip-path to break away from rectangular conventions, employing angled corners, hexagonal frames, or diagonal cuts that make card layouts feel dynamic and modern. Hero sections frequently use clip-path on the bottom edge of a hero container — polygon(0 0, 100% 0, 100% 85%, 0 100%) creates a subtle slant that visually connects the hero to the content below. Hover effects leverage animated clip-path transitions to reveal hidden content — a card that expands from a small circle to a full rectangle on hover, or a button that morphs shape when interacted with. These effects add a layer of polish that distinguishes professional interfaces from template-based designs.

Clip-path also pairs well with other CSS properties for more advanced results. Combining a clipped shape with a box shadow creates depth around non-rectangular elements (though note that shadows follow the original box model, not the clip). Layering clip-path over CSS gradients produces striking masked backgrounds for sections and cards. For three-dimensional transformations applied to clipped elements — like rotating a hexagonal card in perspective — the 3D transform tool handles the matrix math. And when you need a full page layout that incorporates clipped shapes alongside flexible alignment, the Flexbox playground helps you build the surrounding structure.

Frequently Asked Questions

What is clip-path in CSS?

The clip-path CSS property creates a clipping region that defines which part of an element is visible. Anything outside the clipped region becomes transparent, effectively masking the element into shapes like circles, polygons, or ellipses without altering the document flow.

How to create custom shapes in CSS?

Custom shapes in CSS are created using the clip-path property with the polygon() function. You define a series of x and y coordinate pairs as percentages that map out the vertices of your shape. For example, clip-path: polygon(50% 0%, 100% 100%, 0% 100%) creates a triangle.

What is polygon clip-path?

The polygon() function in clip-path defines a shape using a set of vertices connected by straight lines. Each vertex is specified as a percentage pair (x y) representing its position relative to the element's bounding box. It can create any multi-sided shape, from simple triangles and rectangles to complex stars and arrows.

Is clip-path supported in all browsers?

The clip-path property is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. Basic shapes like circle(), ellipse(), inset(), and polygon() have excellent support. The older -webkit-clip-path prefix is no longer needed for current browser versions.

Share This Tool

Found this useful? Share it with your design and development community.

Related Tools

Built by DevPalettes — free tools for developers and designers