CSS Clip-Path Generator

Share:
Developer Tools

CSS Clip-Path Generator

Polygon vertex editor

By Checked against sources by Last reviewed CSS CLIP-PATH FRONTEND POLYGON SHAPES
Your browser is too old for this tool’s interactive features. Please update to Safari 13.1, Chrome or Edge 80, Firefox 74 or newer.

CSS Clip-Path Generator

Presets:
Drag the numbered vertices to shape the polygon.
Live preview
-webkit-clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
Advertisement
After results · AD-W1Responsive · Post-tool — peak engagement

How to use the Clip-Path Generator

Start from a preset

12 ready-made shapes: triangle, trapezoid, parallelogram, rhombus, pentagon, hexagon, octagon, 5-point star, message bubble, arrow, chevron and diagonal banner. Pick the closest match to your target shape; tweak from there. The pentagon and star are the usual box-fitted approximations, not exact regular figures.

Drag vertices to refine

The numbered handles are the polygon's vertices. Drag them on the editor; the right side preview updates live. Coordinates are percentages of the element's border box, so the shape scales with the element. Vertices clamp to the 0-100% range and print to one decimal place.

Add or remove vertices

Complex shapes need more points. New vertex always added between the last and first existing points; drag it into place. Remove the last vertex with the "−" button. Minimum 3 vertices (triangle).

Copy the CSS

Click "Copy CSS" to get a -webkit-clip-path declaration followed by the standard clip-path one, in that order so a browser that reads both ends on the standard property. Paste into your stylesheet. The prefixed line only matters for old Chrome and Safari; current browsers support clip-path unprefixed.

Advertisement
After how-to · AD-W2Responsive

CSS clip-path — non-rectangular elements without SVG

Web layouts historically forced everything into rectangles. border-radius let us make circles + rounded corners; clip-path finally enables arbitrary polygon shapes. The property is defined in CSS Masking Module Level 1; it accepts basic shapes (polygons, circles, ellipses, insets), SVG paths and references to SVG clipPath elements. Polygon clipping — the most common use — accepts an arbitrary list of x,y vertex coordinates as percentages, defining the visible region. Anything outside the polygon is hidden. Use cases: hero-image diagonal banners, message-bubble cards, decorative section dividers, hexagon avatar grids, arrow buttons.

Polygon vs other clip-path syntaxes

The shapes you will reach for most are these five. polygon(x1 y1, x2 y2, ...): arbitrary multi-vertex shape (this tool). circle(radius at x y): perfect circle clipping. ellipse(rx ry at x y): elliptical clipping. inset(top right bottom left round corner-radius): rectangular clipping with optional rounded corners — useful for keyhole effects. path("svg-path-d"): arbitrary SVG path syntax (full curve support). For most polygon shapes: polygon() is simplest. For curves: path() with SVG syntax. For circular/elliptical: dedicated functions. This tool edits polygons, the shape that is hardest to write by hand.

Two polygons with the same number of vertices interpolate smoothly, so a hover effect or a reveal needs nothing but CSS — and the clipped-away area stops receiving clicks, too.

Animating clip-path

clip-path can be transitioned + animated like any other property — as long as the start + end polygons have the SAME number of vertices and the same fill-rule (CSS Shapes Module Level 1, §3.4). Browsers interpolate vertex positions between states; in any other case no interpolation is defined and the shape jumps. Use cases: hover-reveal effects, scroll-triggered reveals, page transitions, button morph animations. Limitation: animating between different vertex counts produces broken interpolations. Workaround: pre-define both shapes with the same vertex count (some can be "stacked" at the same position to effectively have fewer visible vertices). Plain CSS transitions and @keyframes are enough for most of these.

Browser compatibility + accessibility

clip-path with polygon() on HTML elements works unprefixed in Chrome 55+, Firefox 54+ and Edge 79+. For Safari the two public compatibility datasets disagree: caniuse, which tests shapes on HTML elements, gives 13.1, while MDN's browser-compat-data lists the unprefixed property from 9.1. Before that, Chrome (from 23 in MDN's data, 24 in caniuse's) and Safari from 7 took it only as -webkit-clip-path, which this tool also outputs. Accessibility considerations: clip-path hides visual pixels but doesn't affect the DOM. Screen readers + keyboard navigation still find clipped content — be careful with hidden interactive elements. Hit test areas: the clipped-away part is not clickable — CSS Masking says pointer events must not be dispatched on the clipped-out region, so a triangle only takes clicks inside the triangle. If you need the full rectangle to stay clickable, clip a child element instead.

polygon() and four other shapes, vertex matching, and why the clipped corner stops taking clicks

01

clip-path: polygon(x1 y1, x2 y2, ...) defines arbitrary multi-vertex shapes via percentage coordinates.

02

The everyday shapes: polygon, circle, ellipse, inset, path — plus url() to an SVG clipPath.

03

Specified in CSS Masking Module Level 1, a W3C Candidate Recommendation Draft (August 2021).

04

Animatable — two polygons interpolate only if they have the same number of vertices and the same fill-rule.

05

Unprefixed support for shapes: Chrome 55+, Firefox 54+ and Edge 79+; Safari 13.1+ by caniuse's test, 9.1+ in MDN's data. Older Chrome and Safari need -webkit-clip-path.

06

Common uses: hero banners, message bubbles, hexagon avatars, arrow buttons, decorative dividers.

07

The clipped-out region does not receive clicks: the spec forbids dispatching pointer events there.

08

Screen readers see content regardless of clip-path — don't use to "hide" accessibility content.

09

For curves + complex paths: use path("svg-d-string") instead of polygon.

10

clip-path vs mask: clip-path uses geometric shapes; mask uses image alpha — different use cases, both useful.

Frequently Asked Questions

  • clip-path: shaping CSS-styled HTML elements (divs, images, sections). Keeps text + accessibility content intact behind the shape. SVG: when you need vector graphics with strokes, complex curves, gradients, multiple shapes per element, or text following paths. Both have similar visual capabilities; clip-path is simpler for "make this rectangular element non-rectangular." SVG is more powerful for true vector art.

  • It shouldn't. CSS Masking Module Level 1 says pointer events must not be dispatched on the clipped-out region, so a click outside the visible polygon goes to whatever lies beneath it. That is often the clipped element's parent, so a click handler on the parent (or one delegated to document) still fires there, which can look like the clipped element took the click. Check where the listener is attached. If you want the whole rectangle to stay clickable, clip a child element instead and put the handler on the unclipped parent.

  • Yes, with a constraint: start + end polygons must have the SAME number of vertices and the same fill-rule. Browser interpolates between vertex positions. Example use cases: button hover effects that morph rectangles into diamonds, scroll-triggered shape reveals, page transition effects. Workaround for different vertex counts: pre-define both shapes with the higher vertex count; "extra" vertices in one state collapse to the same point. This is more complex but possible.

  • Use the dedicated circle() function instead of polygon: clip-path: circle(50% at center). Or border-radius: 50% — even simpler for full circles on square elements. For ellipses: clip-path: ellipse(40% 30% at center) (width radius, height radius, position). For polygon approximation of circle: 12-24 vertices around a circular path; less efficient than circle() but allows animation between polygon + circular states.

  • overflow: hidden: clips child elements to the parent's rectangular box. Standard CSS layout tool. clip-path: clips the element itself to an arbitrary shape, including its own visible pixels. Use clip-path: when you want non-rectangular shape, including the element's background + borders. Use overflow: when you want to hide overflowing children of a regular rectangular container.

  • Usually, if the shapes interpolate (same vertex count) and the element's size stays put. Whether the browser can run the animation without repainting varies by browser and version, so test on the slowest device you care about — and prefer animating transform and opacity where they can do the job.

  • Current browsers support polygon() unprefixed: Chrome 55+, Firefox 54+, Edge 79+, and Safari from 13.1 by caniuse's test (MDN's data says 9.1). Older Chrome and Safari needed -webkit-clip-path; this tool outputs both, prefixed line first. For IE11 + ancient browsers: clip-path is unsupported; element renders as the underlying rectangle. Best practice: clip-path should be progressive enhancement — design so the rectangular fallback still looks acceptable. Don't put critical content where the clip-path is the only thing hiding it.

  • Yes — clip-path: path("M 10 10 L 90 90 ...") uses SVG's "d" path syntax. Supports cubic + quadratic Bezier curves, arcs, line segments. More powerful than polygon for curved shapes. In MDN's compatibility data, path() in clip-path works unprefixed from Chrome 88, Firefox 71 and Safari 13.1. Trade-off: harder to author manually; this editor sticks to polygon() because straight-edged vertices are easy to drag. For complex curves, design in Figma + export SVG, then extract the d attribute for use in clip-path.

  • No. The editor runs in your browser and sends nothing about your shape to a server; the vertices exist only in the page while it is open. The page itself still loads what every RECATOOLS page loads (the site's scripts and, with your consent, ads and analytics), so DevTools → Network will show those requests, none of which carries your vertices.

  • Pair with: CSS Box Shadow Generator for depth; CSS Cubic-Bezier Editor for animation easing; CSS Gradient Generator for backgrounds; WCAG Contrast Checker for accessibility.

Method & sources

How it computes

A polygon of 3+ vertices, each clamped to 0–100% of the border box and printed to 0.1%, edited by dragging, from 12 presets, or by adding a vertex at the midpoint of the closing edge. Output: -webkit-clip-path then clip-path: polygon(x% y%, …), the CSS Shapes 1 grammar. Text, clamping and presets, tested.

What this tool implements

  • CSS Masking Module Level 1 (W3C CRD, 5 August 2021): clip-path takes a <basic-shape>, sized against the border box when no reference box is given; "pointer-events must not be dispatched on the clipped-out (non-visible) regions". The FAQ said the reverse (the whole rectangle still took clicks) and has been rewritten.
  • CSS Shapes Module Level 1 (W3C CRD, 12 June 2025) §3.1 polygon() grammar; §3.4 two polygons interpolate only with the same number of vertices AND the same fill-rule. The page stated only the vertex condition.
  • Browser support for shapes on HTML elements: Chrome 55, Firefox 54, Edge 79 unprefixed in both caniuse and MDN browser-compat-data. Safari: caniuse 13.1, browser-compat-data 9.1 (prefixed from 7); Chrome prefixed from 24 (caniuse) or 23 (browser-compat-data). The page now names both datasets instead of one number.
  • Corrected 2026-10-26: the copied CSS printed clip-path before -webkit-clip-path (now prefixed first, so the standard declaration wins where both are read); coordinates printed as "50.0%" against the page's own "50%"; the how-to listed nine of the twelve presets; the privacy answer claimed DevTools would show zero outbound requests, which is untrue of a page that loads site scripts and consented ads.

Sources

What can make this go out of date

  • None at runtime: the shape is built and previewed in the browser and nothing about it is sent anywhere.
Advertisement
Pre-footer · AD-W3 728 × 90