SuperDevTools

CSS Clip-Path Generator

polygon() joins the points in order and closes the shape: each point is written "X Y", X from the left edge, Y from the top edge.

Drag the points on the preview; double-click the preview to add a point on the nearest edge. Keyboard: Tab to a point, arrows to move it (Shift + arrow: steps of 10), + to add a point after it, Delete to remove it.

Presets:

Polygon points

Options

Preview box

Drop an image on the preview or choose a file: it stays on your device and is not part of the code.

CSS code

Switching units converts the values: in %, X is based on the box width and Y on its height, so the shape follows the element's size; in px it keeps fixed dimensions.

Everything is calculated in your browser: nothing is sent. The last shape stays on this device.

A visual CSS clip path maker

This clip-path generator lets you draw a shape on a live preview and writes the matching CSS for you. The clip-path property hides everything outside the shape: a photo becomes a hexagon, a hero banner ends in an arrow, a profile picture turns round. Coordinates can be in % or px, and you can drop in your own image to see the real result. Everything runs in your browser.

How to use it

  1. Pick a shape: "Polygon", "Circle", "Ellipse" or "Rectangle (inset)", then a unit (% or px).
  2. For a polygon, drag the points with a mouse or a finger, or type X and Y values under "Polygon points". "Add a point" inserts one after the selected point, double-clicking the preview adds one on the nearest edge, and the × button deletes it.
  3. With a keyboard: Tab to a point, arrows to move it (Shift + arrow: steps of 10), + to add, Delete to remove.
  4. Tick "Snap to grid" to land on round numbers, and "Add -webkit-clip-path" if you support old browsers.
  5. Click "Copy code", or "Copy link" to reopen the same shape later or send it to a colleague.

Fifteen presets give you a head start: Triangle, Rhombus, Pentagon, Hexagon, Octagon, Star, left and right arrows and chevrons, Parallelogram, Trapezoid, Speech bubble, Cross and Message.

Syntax of each shape function

polygon()

A comma-separated list of "X Y" points, joined in order, with the last one linked back to the first. The Triangle preset gives clip-path: polygon(50% 0%, 0% 100%, 100% 100%);: the tip in the middle of the top edge, then the two bottom corners. Switch to px on a 400 × 240 px banner and the Right arrow becomes polygon(0px 48px, 240px 48px, 240px 0px, 400px 120px, 240px 240px, 240px 192px, 0px 192px).

circle()

clip-path: circle(50% at 50% 50%); draws a centred circle. A % radius refers to the diagonal divided by √2, so on a 300 px square, 50% is 150 px and the disc touches all four edges.

ellipse()

clip-path: ellipse(50% 35% at 50% 50%); uses 50% of the width horizontally and 35% of the height vertically. On a 400 × 300 px box, the radii are 200 px and 105 px.

inset()

Offsets follow the top, right, bottom, left order you know from margin, and round rounds the corners. clip-path: inset(10% 20% round 8px); on a 400 × 300 px box removes 30 px top and bottom and 80 px left and right, leaving a 240 × 240 px square with 8 px corners. The tool always writes the shortest form.

Browser support and the prefix

All four functions have worked unprefixed in all current browsers for years. The -webkit-clip-path line only matters for some older browsers; the checkbox adds it before the standard line.

Animating between shapes

Add transition: clip-path .4s; and the browser morphs smoothly from one polygon to another as long as both have the same number of points. A Rhombus (4 points) morphs into a Parallelogram (4 points), but jumps to a Hexagon (6 points). Duplicate a point to even the count. A circle also animates to another circle.

FAQ

Why did my box-shadow disappear?

clip-path clips shadows and borders too. Wrap the element in a parent and give the parent filter: drop-shadow(0 4px 8px rgba(0,0,0,.3)) to get a shadow that follows the shape.

Can users click the hidden parts?

No. Clicks outside the shape pass through, so a rhombus-shaped button only reacts inside the rhombus.

Should I use % or px?

Use % for a shape that scales with responsive images and cards. Use px for a fixed cut, such as a 20 px notch whatever the width. Switching units converts the values.

Are my settings saved?

The last shape stays on this device. A dropped image is never stored or uploaded. Use "Copy link" to share a shape.