CSS Clip Path Generator
Create CSS clip-path shapes with visual editing and presets. Clip-path maker and CSS shape generator in one tool.
Reviewed by Aygul Dovletova · Last reviewed
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
Working with the Clip-Path Maker
- Pick a preset shape from the row at the top - circle, ellipse, triangle, pentagon, hexagon, octagon, star, cross, arrow - or choose "Custom polygon" to start from a blank vertex list.
- Drag the control points directly on the preview surface. Each handle corresponds to a vertex in the underlying
polygon()orcircle()function, and coordinates are expressed as percentages of the element\'s reference box. - Fine-tune numerically using the inputs under the preview. Type exact values when you need a precise shape that aligns to other elements on your page.
- Toggle the reference box (border-box, padding-box, content-box) to see how the same percentages produce different clip regions depending on where the "0% 0%" origin lives.
- Copy the generated CSS. The output is a single
clip-pathdeclaration that works inline, in a stylesheet, or via CSS-in-JS.
Under the hood: how clip-path clips
The clip-path property comes from CSS Masking Module Level 1. It accepts a basic shape function - circle(), ellipse(), polygon(), inset(), path(), or the newer shape() - or a reference to an SVG <clipPath> via url(). At paint time the browser computes the shape against the element\'s reference box and discards any pixel outside that region. Everything inside the shape renders normally; everything outside is simply not painted - hit-testing, pointer events, and selection all follow the clipped outline.
Internally, Chromium and WebKit treat clip-path as a stencil applied during the compositor pass, which is why it\'s cheap to animate and doesn\'t force a layout. Gecko takes a similar path via WebRender. The performance-hot case is clip-path: path() with thousands of Bezier segments, or URL-referenced SVG clips on large elements, both of which fall off the fast path. Basic shapes stay GPU-accelerated regardless of element size, so a polygon over the whole viewport is still cheap.
Where clip-path earns its keep
- Angled section dividers - slanted tops and bottoms on hero sections without SVG backgrounds.
- Diagonal image masks for magazine-style editorial layouts.
- Hexagonal avatar grids for team pages or gaming-inspired UIs.
- Reveal animations that expose content by animating a circle\'s radius from 0 to 100%.
- Decorative callouts - speech bubbles, arrow-tipped ribbons, ticket-stub badges.
- Focus spotlights that darken the page except for a ring around a highlighted onboarding target.
Pitfalls that cost time
- Child overflow is clipped too. Anything extending past the clip path - tooltips, dropdowns, focus rings - will be cut off. Plan the layout so these live in a sibling element, not inside the clipped one.
- Interactive regions shrink. The hit-test area matches the clipped shape. A button with a clip-path has a smaller clickable region than its bounding box suggests, which can surprise users who aim at the corner.
- Animating polygon() requires matching vertex counts. CSS can only interpolate between two
polygon()values if both have the same number of points. For morphing between shapes with different vertex counts, add redundant collinear points to pad the shorter list. - Focus outlines may be clipped. Browser default
:focus-visibleoutlines sit just outside the border box. If clip-path removes that region, keyboard users lose the visible focus indicator - add a custom inner focus style. - Safari older than 13.1 needed
-webkit-clip-pathas a fallback. Modern builds accept the unprefixed property; caniuse.com/css-clip-path shows the full compatibility matrix. - percentages resolve against the reference box, not the viewport. A responsive element with a polygon clip will reshape as it resizes, which is usually desirable but can distort carefully designed angles.
Spec and formal background
CSS Masking Module Level 1 defines the current clip-path property alongside the related mask-* family. Before this spec, clipping was only available via SVG\'s <clipPath> element applied to SVG content - CSS clip-path generalized the idea to any HTML element. The basic-shape functions come from CSS Shapes Module Level 1, which originally defined them for float wrapping (shape-outside) and then got adopted for clipping. Level 4 of CSS Shapes is now adding shape(), a Bezier-capable successor to polygon(), which is shipping in Chrome 132+ and will eventually replace most path() uses. For the deprecated clip property - which only supported rect() - stop using it; it was formally deprecated in CSS Masking Level 1 and will warn in modern DevTools.
Clip-path vs masking vs SVG
Three similar-looking techniques solve overlapping problems. clip-path gives you a hard-edged binary clip - a pixel is either shown or hidden. mask-image gives you soft, per-pixel alpha via any image or gradient, which is what you want for feathered edges, radial vignettes, or texture masks. SVG <clipPath> referenced via url() is the most powerful option - it supports arbitrary Bezier curves and can use clipPathUnits="objectBoundingBox" for reusable shapes - but you ship markup along with the CSS. Rules of thumb: basic polygon or circle = CSS clip-path; soft-edged fade = mask-image with a gradient; complex curved outline = SVG <clipPath>. Compared to drawing a masked image in Figma and exporting a PNG with baked-in transparency, CSS clipping is responsive, themeable, and weighs zero bytes extra. Where it still loses: per-element filters applied after clipping sometimes paint around the clipped area on Safari, and printing clip-path is unreliable across PDF rendering engines.
Frequently Asked Questions
What is the difference between clip-path and overflow: hidden?
<code>overflow: hidden</code> clips children to the element's rectangular padding box - you always get a rectangle. <code>clip-path</code> clips the element itself (including its background and border) to an arbitrary shape - circle, polygon, SVG path, or a gradient-based mask. Use overflow for "stop children from escaping a rectangle" and clip-path for "make the element itself a non-rectangular shape".
Will clip-path hide my element's box-shadow?
Yes - box-shadow is drawn outside the element's border box, and clip-path discards everything beyond the clipping region. If you need a shadow around a non-rectangular shape, use <code>filter: drop-shadow()</code> on the clipped element instead, since drop-shadow follows the alpha outline rather than the rectangle. Be aware that drop-shadow is more expensive on large elements than box-shadow on rectangles.
Can I animate clip-path smoothly?
Yes, with one important constraint: interpolation only works cleanly between two values of the same shape function. Animating <code>polygon(...)</code> to <code>polygon(...)</code> works if both have the same vertex count, in the same order. Animating <code>circle()</code> to <code>circle()</code> always works. You cannot animate <code>circle()</code> directly to <code>polygon()</code> - the browser will jump-cut at the 50% mark. For cross-shape morphing use the newer <code>shape()</code> function (Chrome 132+) or SVG <code><animate></code>.
Why does my clickable element not respond in the clipped-away corners?
Because clip-path also clips the hit-test region. The browser treats the clipped shape as the element's effective footprint for pointer events - clicks in the transparent corners pass through to whatever is underneath. This is almost always the desired behavior for visual shapes, but it can trip you up when you have decorative overlays. If you need the full rectangle to remain clickable, wrap the clipped visual in a rectangular parent that handles the pointer events.
Does this tool send my shape data to a server?
No. The coordinate array, active preset, and computed CSS string all live in Preact component state. The SVG preview is rendered directly from that state, and the copy button writes to the clipboard via <code>navigator.clipboard.writeText</code> without any network call.
Is clip-path supported well enough to ship in production?
Yes. According to caniuse.com/css-clip-path, the basic-shape functions (<code>circle</code>, <code>ellipse</code>, <code>polygon</code>, <code>inset</code>) are at 97%+ global support. Safari from 13.1 onward, Chrome 55+, Firefox 54+, and modern Samsung Internet all work without prefixes. <code>path()</code> support landed later (Chrome 88+, Safari 17+); the newest <code>shape()</code> function is Chromium-only for now.
Why does my polygon look different when the element resizes?
Because polygon coordinates default to percentages, which resolve against the current element size. A perfectly regular hexagon at 400x400 will distort at 400x200 because the vertex percentages produce the same relative positions in a now-rectangular box. Options: use fixed-pixel coordinates, constrain the element's <code>aspect-ratio</code>, or accept the stretching as intentional responsive behavior.
What is the difference between clip-path and mask-image?
Clip-path produces a hard-edged binary clip - every pixel is either fully shown or fully hidden. Mask-image (CSS Masking Level 1) uses the alpha or luminance of an image or gradient as a per-pixel mask, giving you soft edges, feathering, and texture effects. Rule of thumb: if the desired edge is crisp and geometric, pick clip-path; if it fades, gradates, or uses a texture, pick mask-image.
Is "clip-path maker" the same thing as a clip-path generator?
Yes. "Clip path maker", "css clip-path maker", "clip-path generator", "clip-path maker" and "css shape generator" all point at the same kind of tool - one that lets you drag polygon points visually and hands you the final <code>clip-path</code> CSS declaration. This page does exactly that, with circle, ellipse, polygon, star, arrow and custom vertex presets. For triangle-specific work, the <a href="/tools/css-triangle-generator/">CSS triangle generator</a> covers the classic border-trick approach that does not need <code>clip-path</code> at all.
More CSS & Design
Aspect Ratio Calculator
Calculate and visualize aspect ratios for any dimensions.
Open toolBlob Shape Generator
Generate organic blob shapes as SVG.
Open toolBorder Radius Generator
Create CSS border-radius with a visual corner editor.
Open toolCSS Box Shadow Generator
Create CSS box shadows with a visual editor. CSS box-shadow generator, shadow maker and box-shadow builder with live preview, multi-layer support and Material elevation presets.
Open toolColor Palette Generator
Generate harmonious color palettes, Tailwind-style 50-900 scales and design-system tokens from any base hex color. Also a hex color palette generator (Farbpalette Generator auf Deutsch).
Open toolColor Picker
Pick colors visually and get HEX, RGB, and HSL values.
Open tool