CSS Clip-path & Triangle Generator
Draw clip-path polygons by dragging points, start from 15 shapes, or generate a classic CSS border triangle.
Drag points to move them. Double-click an edge to add a point, double-click a point to remove it. Arrow keys nudge the selected point.
.shape {
clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}[clip-path:polygon(50%_0%,_100%_100%,_0%_100%)]
About this tool
The CSS clip-path property cuts an element to a shape: everything outside the shape becomes invisible and stops receiving clicks. With polygon() you can turn any box, image or video into a triangle, hexagon, arrow, speech bubble or slanted section without extra images or SVG files. Before clip-path existed, developers drew triangles with a trick: a zero-size element whose borders meet at an angle, with all but one border transparent. Both techniques are still useful today.
This tool covers both. In polygon mode you drag the points of the shape directly on the preview, double-click an edge to add a point, and start from 15 ready-made shapes or from a regular polygon or star with any number of points. Coordinates snap to 5% by default for clean values, and you can paste an existing polygon() to keep editing it. In triangle mode you pick one of eight directions and a size, and get both the classic border CSS and the modern clip-path version.
How to use CSS Clip-path & Triangle Generator
- Choose clip-path polygon or CSS triangle.
- For a polygon, click a shape to start, then drag the points. Double-click an edge to add a point, double-click a point to remove it.
- Fine-tune a selected point with its X and Y fields or the arrow keys (Shift moves 10%).
- Copy the CSS or the Tailwind arbitrary class. For triangles, choose the direction, width, height and color, and copy either method.
Examples
Hexagon
Shape: Hexagon
clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
Dropdown caret with borders
CSS triangle, down, 20 × 10 px, #333
width: 0; height: 0; border-style: solid; border-width: 10px 10px 0 10px; border-color: #333 transparent transparent transparent;
Slanted hero section
Shape: Slanted bottom
clip-path: polygon(0% 0%, 100% 0%, 100% 85%, 0% 100%); Tailwind: [clip-path:polygon(0%_0%,_100%_0%,_100%_85%,_0%_100%)]
How polygon() coordinates work
- Each point is an x y pair measured from the top-left corner of the element: 0% 0% is the top-left, 100% 100% the bottom-right.
- Points are joined in order and the last point connects back to the first. Changing the order changes the shape.
- Percentages scale with the element, so the same polygon works at any size. Mixing in px or calc() keeps parts fixed, for example a notch that is always 20px.
- Shadows, borders and outlines are clipped too. For a shadow around a clipped shape, apply filter: drop-shadow() to a parent element.
- Two polygons with the same number of points can be animated into each other with a CSS transition on clip-path.
Border triangles or clip-path?
The border method draws a triangle with no content box, so it is ideal for small decorations such as tooltip arrows, dropdown carets and speech-bubble tails, often as a ::before or ::after pseudo-element. It works in every browser ever released, but it cannot hold text or images and its size is set through border widths.
clip-path triangles are normal elements with width, height and a background, so they can contain gradients, images and text, and can be animated. All current browsers support clip-path: polygon() without a prefix. Use clip-path for content and the border trick for tiny arrows.
Frequently asked questions
Everything you need to know about this tool and data security.
Does clip-path affect layout or clicks?
It does not change layout: the element still takes up its full rectangular space. It does change hit testing, so clicks and hover only register inside the visible shape.
How do I add a border to a clipped shape?
A normal border is clipped away along the slanted edges. Instead, put the clipped element inside a slightly larger wrapper with the same clip-path and the border color as its background, or draw the outline with an SVG polygon using the same points.
Can I use circle(), ellipse() or inset() too?
Yes. clip-path also accepts circle(50% at 50% 50%), ellipse(), inset(10% round 12px) for rounded rectangles, and path() with SVG path data. This tool focuses on polygon() because it covers most custom shapes.
Is my data safe when using this tool?
Yes, 100% safe. This tool operates entirely inside your web browser using client-side JavaScript and WebAssembly. Your data never touches any external server.
Related Tools
Generate random organic blob shapes and layered wave section dividers, then copy the SVG or download SVG and PNG files.
Build layered CSS box shadows with a live preview, plus neumorphism and glassmorphism styles.
Design linear, radial and conic CSS gradients visually and copy the CSS or Tailwind classes.
Featured Projects tech-fun.net
Explore more AI & productivity tools
Nihongo GameBox
Master Japanese typing, Kana, and JLPT N5–N1 vocabulary through interactive retro arcade games.
ResumeGPT
Tailors CVs and cover letters to every job opportunity with a multi-agent LLM pipeline, job tracking, and scheduled discovery.
CollectMind
Turns your bookmarks into a searchable AI knowledge base — entirely on-device, powered by Chrome's built-in Gemini Nano.