Skip to main content

CSS Clip Path Generator

What it does

The Clip Path Generator produces CSS clip-path values from a library of preset shapes: circle, ellipse, triangle, parallelogram, trapezoid, rhombus, pentagon through octagon, five-pointed star, arrows, chevrons, speech bubbles, and crosses. Pick a shape, see it applied to a real element at the size and colour you choose, copy the CSS. The output cuts any element down to that polygon (divs, images, even videos) using a property browsers already render natively.

Common situations

You’re building a team page where each avatar should be hexagonal rather than the default circular crop. Achieving hexagonal images with border-radius is impossible (radius produces curves, not flat sides); SVG masks are fiddly for dynamic content. Clip-path makes the entire team page one CSS rule applied to the avatar <img> element.

You’re producing a landing-page hero where the hero band ends in a diagonal cut rather than a straight horizontal edge. The diagonal-divider pattern dominates 2020s marketing site design. Building it as a background SVG works; building it via clip-path on the hero section itself is lighter and scales without any image asset.

You’re building a testimonial component with a speech-bubble shape (a quote in a rounded box with a small tail pointing at the speaker). Composing this with a CSS triangle inside a rounded-rectangle parent works; defining the entire shape as a single clip-path is cleaner and animatable.

You’re producing a “cards with cut corners” pattern: design system cards that have one or two corners notched in a deliberate way. Border-radius cannot produce sharp angles; clip-path with a polygon does.

You’re building a circular-revealing transition effect where a section of the page fades in from a centre point outward. Animating clip-path between two shapes (a small circle to a larger one) produces the reveal without any JavaScript animation library.

What you need to know

clip-path is a CSS property that tells the browser “render this element, but only show the parts inside this shape”. The shape can be a basic function (circle(), ellipse(), inset()) or a polygon defined by a list of percentage points (polygon(50% 0%, 100% 100%, 0% 100%) makes a triangle).

Polygon points are listed in order around the shape, typically clockwise from top-left. Each point is two percentages: x first, y second, both relative to the element’s bounding box. The browser draws straight lines between consecutive points and fills the interior. Anything outside is clipped, which means it does not respond to clicks or take up space differently.

Animation is supported. Animating between two clip-path values with the same point structure produces smooth shape morphs, which is the basis for the “polygon reveals” trend in modern interactive design. Animating between values with different point counts does not interpolate cleanly, which is why most transitions stick to a single shape and animate the points within it.

Browser support is universal in 2026. clip-path on regular block elements works everywhere; some edge cases (clip-path on tables, clip-path with overflow scrolling) have historically been quirky in Safari. For new code, default to clip-path freely; for code that may run in very old browsers, fall back to SVG masks.

Performance is generally good (clip-path is GPU-accelerated in modern browsers), but animating clip-path triggers paint on every frame, which is expensive. For continuous animations, prefer transform-based effects unless the shape change is the whole point of the animation. For one-shot reveals (mouse hover, page load), animated clip-path is fine.

The percentage points are relative to the bounding box, not the visible content. A clip-path on an oversized element will look different when the element resizes, which is useful for responsive design but occasionally surprising. For pixel-precise clipping that does not scale with the element, use absolute units (px, em) rather than percentages.

The newer clip-path: shape() function (CSS Shapes Level 2) lets you define paths using SVG-like commands. It is useful for very complex shapes but not yet universally supported. For 2026 production work, polygon and the basic shape functions are the safest choice.

Frequently asked questions

What is CSS clip-path?

A CSS property that crops an element to a specific shape. Anything inside the shape renders; anything outside is invisible. Supports built-in shapes (circle, ellipse, polygon) and custom polygons defined by point lists.

Can clip-path be animated?

Yes, between two values with the same structure (same number of polygon points). Animating between different point counts produces jumpy results because the browser cannot interpolate between shapes with different structures.

What’s the difference between clip-path and border-radius?

Border-radius rounds rectangle corners; clip-path can produce any shape including non-rectangular ones (hexagons, triangles, stars, arrows). For circular avatars, both work. Border-radius is more compatible with older browsers; clip-path is more flexible if the design later demands hexagons.

Does clip-path work on images?

Yes. Apply it directly to the <img> element. The image displays only inside the clip-path’s shape; outside is transparent. Combine with object-fit: cover to handle non-square sources cleanly.

Can I clip a video with CSS?

Yes. clip-path works on <video> elements identically to images. Useful for circular video portraits, hexagonal video avatars, or non-rectangular video layouts.

How do I make a hexagonal avatar?

Apply clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%) to a square element. Pair with aspect-ratio: 1 to ensure the element stays square. The image inside (or background colour) takes the hexagonal shape.

Can I round the corners of a clip-path?

The basic polygon syntax does not support rounded vertices; corners are sharp. The newer clip-path: shape() function (with curve commands) supports rounding but is not yet universally implemented. For rounded-corner clip-paths in production, use SVG masks instead.

Does clip-path affect layout or just visibility?

Just visibility. The element still occupies its full bounding-box space in the layout. Adjacent elements behave as if the clipped element were the full rectangle.

Common problems

Problem: clip-path on an image gets clipped further by its parent’s overflow:hidden.

The image clips correctly, but the parent’s overflow rules cut off any visible portion that extends beyond the parent. Make sure the parent has enough space (or no overflow:hidden), or apply the clip-path to the parent itself.

Problem: Animating clip-path between two polygons produces jumpy transitions.

The two polygon values must have the same number of points for smooth interpolation. Animating from a 3-point triangle to a 6-point hexagon produces undefined behaviour. To morph between shapes, define both with the same point count (a “triangle” with duplicated points to match a hexagon’s 6).

Problem: clip-path looks correct in Chrome, broken in Safari.

Safari historically had issues with clip-path on certain elements (tables, flex children, elements with overflow scrolling). Test in Safari specifically; the workaround is usually adding position: relative or wrapping in an extra element.

Problem: Hexagonal avatar looks correct on desktop but distorted on mobile.

The percentage points scale with the element’s bounding box, but the bounding box’s aspect ratio matters for the rendered shape. Ensure the element is square (aspect-ratio: 1) at every viewport, or accept that the hexagon will stretch on non-square containers.

Problem: Animating clip-path causes janky scrolling on the page.

Animation triggers paint on every frame, which can affect scroll performance. Limit animated clip-paths to one or two on the page at a time; for continuous-motion effects, use transform instead.

Quick guides

Hexagonal avatars (CSS): aspect-ratio: 1; clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); object-fit: cover on the <img> element handles square + non-square source images correctly.

Diagonal section dividers: Apply clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%) to a section element to produce a section ending with a downward-sloping diagonal edge. Adjust the percentages to control the slope angle.

Animated reveal effect: Define two clip-path values (small circle, large circle), transition between them on hover or load. clip-path: circle(0% at 50% 50%) to clip-path: circle(150% at 50% 50%) produces a centre-out reveal.

Tips

  • Use clip-path on img elements directly rather than wrapping the image in a clipping div. Fewer DOM nodes, simpler CSS, no overflow gotchas.
  • For photographs that need to be hexagonal or star-shaped, use cover-style sizing (object-fit: cover) inside a square element, then apply the clip-path to that square. The image fills before clipping.
  • Browser support is universal in 2026, but clip-path on tables and display: contents elements has historically been quirky. Stick to block-level and flex elements where possible.
  • Animating clip-path triggers paint on every frame, which can be expensive. For continuous animations, prefer transform-based effects unless the shape change is the whole point of the animation.
  • The percentage points are relative to the bounding box, not the visible content. A clip-path on an oversized element will look different when the element resizes.
  • For complex curved shapes, SVG masks are still the better tool; clip-path’s polygon syntax does not support smooth curves natively.
  • Define common clip-path values as CSS custom properties (--shape-hex: polygon(...)) for reuse across components.

Related tools in this suite

Both tools live in the Design Suite. The CSS Triangle Generator covers the simpler end of the same workflow: the border trick is still smaller and faster than clip-path for plain triangles. The Border Radius Generator covers the rounded-corner side.

Take it further

Decorative shapes scattered across a stylesheet are a sign the design system has not formalised them. The systems we build absorb shape decisions into named, documented components (Avatar.hexagonal, Section.diagonal-cut, Quote.bubble) so the geometry decision happens once and is reused, rather than every developer or designer re-rolling clip-path values from memory.

Want a website built and looked after for you?

We build small-business websites for £499 +VAT, then £59 +VAT a month covers hosting, support and small changes from our UK team. Tell us what you need and a real person will reply, usually within a few hours.

The audit is a score out of 100 and what to fix first, emailed within 24 hours.