CSS Clip-Path Generator
Draw clip-path shapes over an image and copy responsive CSS — polygon, circle, ellipse, inset or path.
Shape editor
4-point polygonImport an existing value
Live preview and CSS
4-point polygonclip-path updated
clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%) border-box;
Examples
Diagonal hero
Four-point polygon with a slanted bottom edgepolygon(0% 0%, 100% 0%, 100% 80%, 0% 100%)Percentage points keep the cut at the same relative position on every viewport.
Rounded inset
Top 10%, right 5%, bottom 12%, left 8%, round 20pxinset(10% 5% 12% 8% round 20px)The radius stays in pixels while side offsets remain responsive — a common card treatment.
Invalid path
0 0 L 10 10Validation error: an SVG path must begin with MThe editor explains the failure instead of emitting CSS the browser would silently drop.
About this tool
CSS Clip-Path Generator builds reusable clip geometry instead of baking a mask into pixels. Drag polygon points over a sample stage, use circle, ellipse or inset presets with sliders, or paste an SVG path string for path() mode. The CSS panel updates as you edit and can include the legacy -webkit-clip-path line for older Safari.
Coordinates are stored on a 0–100 viewBox and serialized as percentages by default. That matters for responsive layouts: a 100% point stays at the right edge whether the element is 300px or 3000px wide. A pixel mode is available when exact natural dimensions are needed, and the stage width/height fields define the anchor values.
The editor supports keyboard and pointer workflows: points are focusable, arrow keys nudge by 1% (Shift for 5%), edge midpoints can be inserted as new points, and overlapping points are called out. Path mode validates the d string before emission and rejects percentage coordinates — path() is pixel-based. What you get is CSS, not a raster image.
What this tool does not do
- No image upload: the editor uses a built-in gradient stage, so shape math is the deliverable rather than pixel editing.
- Undo/redo history, shareable URLs and autosave are not implemented in this version.
- Animation output requires equal polygon point counts and is available through the pure module rather than the UI.
- Path validation uses a lightweight syntax check plus the browser's Path2D parser; it is not a full SVG grammar validator.
- Pixel output is anchored to the stage dimensions entered by the user, not to an uploaded image's natural size.
How to use this tool
Pick a shape mode
Choose Polygon, Circle, Ellipse, Inset or Path from the mode tabs.
Edit the shape
Drag points with a pointer, or focus a point and use arrow keys. Use Add point for a new midpoint and Remove point to delete the selected one.
Adjust parameters
Circle, ellipse and inset modes expose sliders for every value, including the inset round radius.
Choose units
Keep percentages for responsive output, or switch to px and set the natural stage dimensions.
Copy the CSS
Read the live declaration, optionally enable the -webkit- prefix, and copy the generated rule.
Use cases
Angled heroes
Cut a diagonal edge into an image without exporting a new asset.
Blob cards
Design an organic polygon and paste the declaration into a component stylesheet.
Image reveals
Prototype a circle/ellipse reveal and keep it responsive with percentages.
SVG authoring
Convert an existing path d string into a clip-path declaration with validation.
Shape modes
| Mode | Output |
|---|---|
| Polygon | polygon(x% y%, …) with any number of points. |
| Circle | circle(radius at x y). |
| Ellipse | ellipse(rx ry at x y). |
| Inset | inset(top right bottom left round radius). |
| Path | path('…') from an SVG d string; pixel coordinates only. |
Prefixing with -webkit-clip-path is optional; modern browsers use the unprefixed property.
Common mistakes
Mistake:Using percentages inside path().
Fix:path() takes pixel coordinates; the validator rejects % and suggests polygon mode for responsive shapes.
Mistake:Assuming polygon animation works with different point counts.
Fix:The pure module exposes an animation helper that refuses mismatched counts — keep point counts equal for interpolation.
Mistake:Editing a two-point polygon and wondering why nothing is visible.
Fix:At least three points are required to enclose an area; the editor flags this explicitly.
Mistake:Expecting a raster mask export.
Fix:This tool emits CSS only. A separate image-shape-masker is needed to bake shapes into pixels.
Mistake:Forgetting the hover target follows the clipped shape.
Fix:Clip-path changes hit-testing too; keep an unclipped wrapper if you need a larger interaction area.
Frequently asked questions
Why do my clip-path points break on mobile?
Pixel coordinates are tied to one fixed size. Keep the default percentage units: each point resolves against the element's border box, so the shape scales with the layout.
How do I animate between two clip-path shapes?
Both polygons must have the same number of points. The pure module provides an animation helper that emits @keyframes and refuses mismatched point counts; this avoids the browser snapping between shapes.
Must polygon point counts match for transitions?
Yes. A browser can only interpolate between compatible shape functions with matching point lists. Use Add point on the shorter shape until the counts match.
Which browsers support path()?
Modern Chromium, Safari and Firefox releases support path() with pixel-based SVG d strings. Older Safari needs the -webkit-clip-path prefix, which the generator can include.
Can I use my own image?
This version ships a built-in gradient stage and does not accept uploads. Its purpose is geometry and CSS output; use a raster masker if you need to bake a shape into an image file.
How do I edit points with a keyboard?
Tab to a point in the SVG overlay and use the arrow keys to move it 1%; hold Shift for 5% steps. Add point and Remove point are regular buttons.
Why is path() rejected when I paste percentages?
The CSS path() function uses pixel units, so percentages are invalid. The validator stops the paste with an explanation and suggests polygon mode for a responsive version of the same shape.
References & standards
Related tools
Aspect Ratio Calculator
Calculate dimensions and ratios for images and videos.
Border Radius Generator
Visually craft CSS border-radius values — including the advanced 8-value slash syntax for organic blob shapes — with a live preview and one-click copy.
Box Shadow Generator
Visual CSS box-shadow generator. Create beautiful shadows with live preview and copy the CSS code.
CSS :has() Selector Playground
Try the CSS :has() parent selector on live editable HTML and CSS, with ten patterns, dropped-rule detection and specificity notes.
CSS Button Generator
Design buttons with hover, active, focus-visible and disabled states — gradients, shadows, borders, icons — and copy clean CSS or Tailwind.
CSS Grid Generator
Visually build CSS Grid layouts — set columns, rows and gaps, see a live preview, and copy production-ready grid-template CSS.