Cut corners and shapes with CSS clip-path
Pick a cut size or paste a clip-path, see it on a button, card or photo, and copy the CSS, Tailwind or SVG.
- Free, no sign-up
- Runs in your browser
- CSS, Tailwind, SVG
Type cut 14px, cut top-left bottom-right 10px or a shape name like hexagon. Or paste CSS, a Tailwind class or an SVG polygon, or drop a .css or .svg file here or .
No shape in mind? Try one:
How it works
- Start from a size or a shape. Type
cut 14pxfor four cut corners, name the corners (cut top-left bottom-right 10px), type a shape likehexagon, or paste theclip-pathyou already have. CSSvar()andcalc()sizes, Tailwind[clip-path:...]classes and SVG<polygon>points are read. - See it on a real element. A button, card, panel or photo, at its real size. Drag the round handles to move a point; it snaps to the edges and the middle.
- Try other widths. Cuts are written in px from each edge (
calc(100% - 14px)), so they keep their size and angle when the element grows. Switch to percent if you want the shape to stretch. - Check it. The page flags cuts that fold over on a smaller element, cut sizes that do not suit the element, buttons under 44 px, text padding narrower than the cut, and borders, outlines or shadows that
clip-pathcuts away, and fixes most in one press. - Copy it. As CSS with a
--cutvariable and a focus style that survives the clip, a Tailwind class, an HTML snippet, the bare value, or an SVG.
Questions
- How do I cut the corners of a div with CSS?
- Use
clip-path: polygon()with two points per cut corner, one on each edge, the same distance from the corner. Write the far edges ascalc(100% - 14px)so the cut stays 14 px on any width. - Why px instead of percent?
- A percent cut is a share of the width across and of the height down, so on a wide box it is no longer 45 degrees, and it grows with the box. A px cut keeps the same size and angle on a 44 px button and a 600 px panel.
- What cut size should I use?
- About 6-10 px for buttons and small controls, 12-18 px for cards and 20-32 px for large panels. Use one size per kind of element so the cuts read as one system.
- Why did my border or focus outline disappear?
clip-pathclips everything the element paints: its border along the diagonals, its outline and its box-shadow. Draw the border with an outer wrapper that has the same clip-path and a padding the width of the border, and show focus inside the shape. The code here does both.- Which Tailwind version does the class need?
- Arbitrary properties like
[clip-path:polygon(...)]work in Tailwind v3.3 and later, including v4. Underscores stand for spaces. - Is anything uploaded?
- No. Reading, previewing, checking and writing the code all happen in your browser. Only the optional AI step sends your description and the shape on screen, and only when you press its button.