CSS clip-path Generator: Crop Elements Into Any Shape Without Images
Build triangles, hexagons, stars, and section dividers with the CSS clip-path property. Drag points visually and copy production-ready clip-path CSS — no SVG or images needed.
The CSS clip-path property is one of the most expressive yet underused tools in modern frontend development. It lets you crop an element into any shape you want — triangles, hexagons, stars, speech bubbles, circles, diagonal section dividers — without a single image, SVG mask, or wrapper element. The browser does all the work on the GPU, the result scales perfectly at any resolution, and the shape can be animated and transitioned like any other CSS value. The catch is that writing clip-pathby hand is painful: counting percentages for a ten-point star is nobody's idea of fun. That is exactly the problem a CSS clip-path generator solves.
This guide explains what clip-path does, walks through each shape function, shows real-world use cases with copy-ready code, and demonstrates how to build any shape visually with the BrowseryTools CSS clip-path Generator by dragging points instead of typing coordinates.
What Is CSS clip-path?
The clip-path property defines a clipping region — only the part of the element inside the region is painted, and everything outside is hidden. Unlike overflow: hidden, which can only clip to a rectangle, clip-path accepts geometric shape functions that can describe almost any outline. The clipped element still occupies its normal box in the layout; only its visible pixels change.
Because clipping happens at paint time, the underlying content — text, images, backgrounds, even videos — is fully preserved and accessible. You are not deleting content, just masking how it is drawn. This makes clip-path ideal for decorative cropping where the content beneath still matters for SEO and screen readers.
The Four Shape Functions
1. polygon()
The most powerful function. You supply a list of x ycoordinate pairs, and the browser connects them in order to form a closed shape. Coordinates are usually percentages relative to the element's box, where 0% 0% is the top-left corner and 100% 100% is the bottom-right.
/* Triangle pointing up */
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
/* Hexagon */
clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
/* Diagonal section divider */
clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);2. circle()
Crops the element to a circle. You give a radius and a center position with the atkeyword. A radius of 50% centered produces a perfect inscribed circle.
/* Perfect circle */
clip-path: circle(50% at 50% 50%);
/* Off-center spotlight */
clip-path: circle(40% at 30% 30%);3. ellipse()
Like circle() but with independent horizontal and vertical radii, letting you make ovals that stretch to fit non-square elements.
clip-path: ellipse(50% 35% at 50% 50%);4. inset()
Crops a rectangular inset from each edge, with optional rounded corners via the roundkeyword. This is the easiest way to add rounded corners to only part of an element or to create a bordered window effect.
/* Inset 10% from each side with rounded corners */
clip-path: inset(10% 10% 10% 10% round 12%);Real-World Use Cases
Angled Section Dividers
The diagonal "swoosh" between landing-page sections that designers love is a single polygon. No SVG, no background image:
.section-angled {
clip-path: polygon(0 0, 100% 0, 100% 88%, 0 100%);
}Hexagon Avatar Grids
Team pages and gaming UIs frequently use hexagonal avatars. A hexagon clip on a square image container gives you the shape instantly, and because the image stays intact it remains crisp on retina screens.
Reveal Animations
Because clip-path is animatable, you can build dramatic reveal effects by transitioning between two polygons with the same number of points:
.reveal {
clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
transition: clip-path 0.6s ease;
}
.reveal.is-visible {
clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}clip-path Shape Comparison
| Function | Best For | Example |
|---|---|---|
| polygon() | Triangles, stars, dividers, custom shapes | polygon(50% 0, 100% 100%, 0 100%) |
| circle() | Round avatars, spotlights | circle(50% at 50% 50%) |
| ellipse() | Oval crops on wide elements | ellipse(50% 35% at 50% 50%) |
| inset() | Rounded windows, edge crops | inset(10% round 12%) |
Common Mistakes
- Mismatched point counts in animations. To animate between two polygons smoothly, both must have the same number of vertices. If they differ, the transition snaps instead of morphing.
- Forgetting the
-webkit-prefix. Older Safari versions still require-webkit-clip-pathalongside the standard property. Always output both. - Clipping interactive elements. The clipped-away area is invisible but the element's box still receives pointer events outside the visible shape unless you account for it. Test hit areas on buttons.
- Hardcoding pixel coordinates. Use percentages so the shape scales with the element instead of breaking at different sizes.
Using the BrowseryTools CSS clip-path Generator
The CSS clip-path Generator turns coordinate math into direct manipulation. Here is how to use it:
- Pick a shape type: Toggle between Polygon, Circle, Ellipse, and Inset at the top.
- Drag the vertices: In polygon mode, drag the handles on the live preview to reshape the outline, or fine-tune each point with X/Y sliders.
- Add or remove points: Build anything from a triangle to a complex star with the add and delete controls.
- Start from a preset: Load triangle, rhombus, pentagon, hexagon, star, message bubble, arrow, or chevron, then customise.
- Copy the CSS: The output includes both the standard and
-webkit-prefixed declarations, ready to paste.
Everything runs entirely in your browser — no shape data is ever uploaded. The tool works offline once the page has loaded.
Browser Support
The clip-path property with basic shapes is supported in all modern browsers — Chrome, Firefox, Safari, and Edge — covering well over 97% of global usage. Including the-webkit-clip-path prefix covers the remaining older WebKit versions. It is safe to use in production today for decorative clipping.
Build any clip-path shape visually — no coordinate math
Drag points on a live preview, choose from presets, and copy production-ready CSS. Runs entirely in your browser with nothing sent to a server.
Open CSS clip-path Generator →Try the Tools — 100% Free, No Sign-Up
Everything runs in your browser. No uploads. No accounts. No ads.
Explore All Tools →