CSS Free, no sign-up

CSS clip-path generator

Pick a shape preset or drag points directly on the preview canvas — the live preview updates immediately and ready-made clip-path CSS code appears below.

Result
Ready-made CSS
.shape {
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

How to use it

  1. Select a shape preset (triangle, chevron, trapezoid, beveled corners, arrow, star) or start a custom polygon.
  2. Drag the handle points on the live preview canvas. Percentage coordinates update in real time.
  3. Switch between Polygon, Circle, Ellipse, and Inset modes, and adjust radii or offsets as needed.
  4. Toggle the preview background (gradient, photo, dark, light) to test transparency, then click “Copy”.

How it works

What is clip-path and how does it work?

The clip-path CSS property creates a clipping region that sets what part of an element is visible. Anything outside the region is hidden and does not receive pointer events. Unlike the obsolete clip property, clip-path supports rich geometric shapes and does not require position: absolute.

.element {
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

polygon() syntax and coordinate space

polygon(x1 y1, x2 y2, ...) takes a comma-separated list of coordinate pairs. Coordinates run from the top-left corner (0% 0%) to the bottom-right corner (100% 100%). Points are ordered clockwise. Length units such as px, rem, or calc() can also be used instead of percentages.

clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), 0 100%);

circle(), ellipse() and inset()

circle(radius at x y) creates a circular mask centered at a specified point. ellipse(rx ry at x y) allows different horizontal and vertical radii. inset(top right bottom left round radius) cuts into the element from its edges and supports rounded corners via the round keyword.

clip-path: circle(50% at center);
clip-path: inset(10px 20px round 12px);

Animating clip-path

Shapes defined by clip-path can be transitioned with CSS transition or @keyframes as long as both states share the exact same number and type of vertices. For instance, a 4-point rectangle smoothly morphs into a 4-point trapezoid, but cannot directly interpolate into a 5-point star.

.card:hover {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

Shadows and clip-path (box-shadow)

A crucial quirk: clip-path clips out the element's own box-shadow! To cast a shadow around a clipped shape, apply filter: drop-shadow(...) to the element or its container — drop-shadow follows the exact clipped contour.

.card {
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

FAQ

Why does box-shadow disappear with clip-path?

clip-path clips everything outside the path, including the box shadow. Solution: use filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25)) instead.

Can clipped areas receive mouse clicks?

No. Everything cut off by clip-path is excluded from hit testing (pointer-events). Clicks pass right through clipped regions to underlying elements.

Is clip-path supported across all browsers?

Yes. Modern versions of Chrome, Edge, Safari, and Firefox support clip-path natively. Vendor prefixes like -webkit-clip-path are only needed for legacy iOS WebKit.

When should I use clip-path versus an SVG?

Use CSS clip-path: polygon(...) for UI components like beveled buttons, banners, and hero section dividers. Use SVG clip-path: url(#id) when you need intricate bezier curves or complex vector illustrations.

This topic in the HTML & CSS course

More CSS tools

CSS gradient generator Linear, radial and conic gradients: pick colors, angle and stops, then copy the code. Flexbox generator and playground Try flex properties on a container and its items: direction, alignment, gaps and ready-made CSS. CSS Grid generator Set columns and rows, gaps and alignment, then copy the ready-made grid code. CSS box-shadow generator Pick offset, blur, color and layers for a shadow, then copy the ready-made box-shadow code. Cubic-bezier generator Drag the control points of an easing curve and copy the ready-made CSS transition. SVG animation generator Pick a shape and an effect — get inline SVG and CSS keyframes ready to paste. CSS specificity calculator Type selectors to see their (a,b,c) weight, a color-coded breakdown and which rule wins. CSS box model visualizer See content, padding, border and margin as a DevTools-style diagram and copy the CSS. CSS transform generator Move, rotate, scale and skew an element, see its original position and copy the code. CSS clamp() calculator Enter min and max font size and viewport width — get a ready clamp() for fluid typography. Color contrast checker (WCAG) Check text and background contrast against WCAG AA and AAA, and fix a failing pair of colors. CSS glassmorphism generator Frosted glass effect: backdrop-filter blur, saturation, border highlight and clean CSS. CSS border-radius (Blob) generator Organic shapes and 8-value border-radius: tune horizontal and vertical corner radii. CSS Stacking Context & z-index Visualizer Why z-index: 9999 fails! Explore CSS Stacking Contexts in interactive 3D exploded layers with transform, opacity and isolation triggers. CSS aspect-ratio & object-fit Generator Eliminate squished images & CLS layout jumps: live aspect-ratio proportions and interactive object-position focal point. CSS Filters Studio & Generator Photo effects without design tools: blur, contrast, hue-rotate, sepia, and trending Instagram-style presets. OKLCH Color Picker & Palette Generator Perceptually uniform brightness & vibrant Display P3 colors: OKLCH picker, design system scales, and fallbacks. CSS Scroll-driven Animations Generator Scroll-linked animations without JavaScript: animation-timeline scroll() & view(), reading progress bar & reveal on scroll. CSS Container Queries (@container) Generator Beyond viewport media queries: components adapt directly to their parent container width. Live resizer & @container rules.
WhatsApp