The CSS Clip Path Generator cuts an element into a shape, hiding everything outside the chosen outline while keeping the element itself in place. Clip paths turn ordinary rectangles into circles, diamonds, hexagons, stars, arrows, and chevrons, opening up design possibilities that borders and border-radius cannot reach. A circular portrait, a star badge, or a hexagonal icon all start with the same idea: define the visible region, and let the rest disappear.
Writing a clip-path value by hand means listing polygon coordinates as percentages, and a single wrong number distorts the shape. The CSS Clip Path Generator offers eight ready-made shapes with correct coordinates, a size control for the two shapes that need one, and a fill colour picker. The preview shows a square box clipped to the chosen shape, and the CSS panel shows the single clip-path declaration to copy.
What Is the CSS Clip Path Generator?
The CSS Clip Path Generator is a visual editor for the CSS clip-path property. It offers eight shapes: Circle, Ellipse, Triangle, Diamond, Hexagon, Star, Arrow, and Chevron. Circle and ellipse use the circle and ellipse functions with a size value and a centre at 50 percent in both directions. The other six shapes use the polygon function with fixed percentage coordinates that trace the outline of the shape.
The size slider runs from 20 to 100 percent and affects only the circle and ellipse shapes, as the hint beneath the control explains. For a circle, the size is the radius as a percentage. For an ellipse, the size is the horizontal radius, and the vertical radius is set to 70 percent of that value, giving a wide oval. For polygon shapes, the size slider has no effect, because the shape is defined entirely by its fixed coordinates. The fill colour picker sets the background colour of the preview box, which is the colour the clipped shape will show.
The preview is a square box 220 pixels wide and tall, centred in the preview area, filled with the chosen colour and clipped to the selected shape. The output is a single clip-path declaration. In the preview, the tool also applies the webkit-prefixed version for compatibility, but the copied CSS contains the standard declaration. The element keeps its original box in the layout; only its visible painting is clipped.
- Eight shapes: Circle, Ellipse, Triangle, Diamond, Hexagon, Star, Arrow, and Chevron.
- Size control: a slider from 20 to 100 percent, applying to circle and ellipse only.
- Fill colour picker: the background colour shown inside the clipped shape.
- Square preview: a 220 pixel box that shows the true proportions of each shape.
- Single declaration output: one clip-path line with the full shape value.
How to Use the CSS Clip Path Generator
Choose the shape first, then adjust the size if the shape supports it, and finally pick the fill colour.
- Choose a shape. Use the Shape dropdown to select Circle, Ellipse, Triangle, Diamond, Hexagon, Star, Arrow, or Chevron. The preview box is clipped to the shape immediately.
- Adjust the size for circles and ellipses. If you chose Circle or Ellipse, drag the Size slider between 20 and 100 percent. Smaller values shrink the visible shape inside the box, leaving more empty space around it. Larger values fill the box more completely.
- Ignore the size slider for polygons. If you chose Triangle, Diamond, Hexagon, Star, Arrow, or Chevron, the size slider will not change the shape. This is expected behaviour, because those shapes are defined by fixed coordinates.
- Pick the fill colour. Use the Fill color picker to choose the colour inside the shape. The colour is a preview aid; the copied CSS contains only the clip-path declaration, so you must set the background or content colour in your own rule.
- Study the shape proportions. Look at the preview at its full size. Check that the shape reads clearly: a star should have distinct points, a hexagon should have flat top and bottom edges, and an arrow should have a clear head and tail.
- Read the generated value. Look at the clip-path declaration in the CSS panel. For polygons, notice how the coordinate pairs trace the outline clockwise. Understanding the coordinates helps if you later edit the shape by hand.
- Copy the CSS. Click Copy CSS and paste the declaration into the rule for your element. Add a background colour, an image, or content to the element in your own code, because the clip-path alone only defines the visible region.
Key Features of the CSS Clip Path Generator
The tool provides correct, tested shape values that would be tedious to calculate by hand, especially for the star and hexagon.
- Correct polygon coordinates: the triangle, diamond, hexagon, star, arrow, and chevron use coordinate sets that trace clean, symmetrical shapes.
- Centre-based circles and ellipses: both curved shapes are centred at 50 percent in each direction, so they stay balanced inside any square element.
- Proportional ellipse: the ellipse vertical radius is derived from the size at 70 percent, giving a pleasing wide oval without a second control.
- Clear size hint: the control explains that size affects only circle and ellipse, preventing confusion when polygon shapes do not respond.
- True-shape preview: the square preview box shows each shape without distortion, which matters for judging symmetry.
- Minimal output: one declaration, easy to paste into an existing rule alongside other properties.
Practical Use Cases
Clip paths suit decorative shapes and image treatments where the element should break out of the rectangle without extra image assets.
Circular avatars and portraits
A circle clip path is the classic treatment for profile pictures and team portraits. Apply the circle value to a square image element, and the corners disappear, leaving a clean disc. A size of 50 percent fills the square exactly, which is the default in this tool.
Badges, stars, and ratings
A star shape makes a natural badge for a favourite, a featured item, or a rating indicator. A hexagon suits a technical or gaming aesthetic, and a diamond suits a jewel or premium marker. Because the shape is CSS, its colour can change with a single background value.
Arrows and chevrons in navigation
Arrow and chevron shapes work as directional cues in step indicators, breadcrumbs, and call-to-action buttons. A chevron pointing right suggests forward movement, while an arrow can serve as a submit or next indicator. Pair the shape with text in a separate element, because clipped elements can hide overflowing content.
Section shapes and image masks
Large images clipped to a triangle, diamond, or hexagon create distinctive section headers and gallery treatments. The image itself stays a normal element, so it remains responsive, while the clip path gives it a memorable outline. Test the result at several screen widths, because the shape scales with the element.
Decorative dividers and accents
Small clipped shapes can serve as bullets, dividers, or decorative accents beside headings. A row of diamonds or hexagons in brand colours adds visual interest without images, and the shapes stay sharp at any resolution.
Tips and Best Practices
Clipping changes what is visible, not what is in the document. Keep that distinction in mind when you design with shapes.
- Use square elements for symmetrical shapes: circles, stars, and hexagons look best on square boxes. On a wide rectangle, the same percentages produce a stretched shape.
- Keep content inside the shape: text or icons placed inside a clipped element may be cut off near the edges. Keep important content well inside the visible region, or place the text outside the clipped element.
- Remember the layout box is unchanged: clipping does not change the space the element occupies. Neighbouring elements still see the original rectangle, so plan spacing accordingly.
- Test on the real element size: a shape that looks balanced at 220 pixels may look different at 48 pixels, especially a star with fine points. Check the smallest size you will use.
- Combine with background, not border: borders are clipped along with the rest of the element, so a clipped element with a border may lose parts of it. Use a background colour or image to fill the shape.
- Check browser support for your audience: clip-path with basic shapes is supported by modern browsers. If you serve very old browsers, provide a rectangular fallback by ensuring the unclipped element still looks acceptable.
Limitations
This generator offers eight fixed shapes. It does not support custom polygon editors, draggable points, inset rectangles, path-based clips, or animated transitions between shapes. The polygon coordinates cannot be edited in the tool, and the size slider affects only the circle and ellipse. The copied CSS contains the standard clip-path declaration only, without the webkit prefix that the preview applies internally.
The preview shows the shape on a plain coloured square. It cannot show how the shape will look with an image, with text content, or at a different aspect ratio. Clipping also hides content outside the shape, including shadows and overflowing children, which can surprise designers who expect a box shadow to follow the clipped outline. It does not; shadows are clipped too.
- Eight fixed shapes; no custom polygon editing.
- Size control applies to circle and ellipse only.
- Output is the standard declaration only, without prefixes.
- Shadows and overflowing content are clipped with the shape.
Frequently Asked Questions
Why does the size slider do nothing for the star shape?
The size slider affects only the circle and ellipse shapes, whose size is a parameter of the shape function. Polygon shapes such as the star are defined by fixed coordinates that already span the element, so there is no size parameter to change. The hint beneath the slider states this directly.
Does clip-path change the space the element takes up?
No. Clip-path changes only which parts of the element are painted. The element still occupies its original rectangular box in the layout, and surrounding elements are positioned as if the element were still a full rectangle. Plan margins and gaps with the full box in mind.
Can I use clip-path on an image?
Yes. Apply the clip-path declaration to the image element or to a container holding the image. The image will be cut to the shape, and the corners will show whatever is behind the element. Use a square image for symmetrical shapes to avoid distortion.
Why does my box shadow disappear when I add a clip-path?
A clip path clips everything painted by the element, including its shadow, because the shadow is drawn outside the visible region. To show a shadow around a clipped shape, apply a drop-shadow filter to a parent element in your own stylesheet, or place the clipped element inside a wrapper that carries the shadow.
What do the polygon percentages mean?
Each pair in a polygon is a point, given as a horizontal percentage and a vertical percentage of the element size. The points are connected in order to form the outline. For example, 50% 0% is the top centre, 0% 100% is the bottom left, and 100% 100% is the bottom right.
Clip Paths and Responsive Design
Clip path values in this tool are expressed as percentages, which means the shape scales with the element. That scaling is a strength and a trap at the same time. On the one hand, a star that looks right at 220 pixels will keep its proportions at 440 pixels and at 110 pixels, because every coordinate is relative to the element size. On the other hand, the shape also stretches when the element changes aspect ratio: a circle defined as fifty percent on a wide rectangle becomes a wide ellipse in practice, and a hexagon on a tall narrow box becomes a tall narrow hexagon that no longer reads as a hexagon at all.
The practical answer is to control the aspect ratio of the clipped element. For symmetrical shapes such as circles, stars, and diamonds, give the element equal width and height, or use an aspect-ratio rule in your own stylesheet, so the shape keeps its intended proportions at every screen size. For arrows and chevrons, a wide rectangle is often the intention, because those shapes are naturally wider than they are tall, but the exact ratio still matters: an arrow that is too wide looks like a ribbon, and one that is too narrow looks like a wedge. Test the shape at the smallest and largest sizes it will appear, not only at the preview size.
Clip paths also interact with responsive images in a useful way. An image inside a clipped container keeps its responsive behaviour, scaling down with the viewport, while the clip path keeps cutting the same relative shape. That combination is what makes clipped image treatments practical for real sites: the designer defines the shape once, and the shape adapts to every device. Just remember to check the focal point of the image at small sizes, because clipping can hide the subject of a photograph when the visible region shrinks.
Related Tools
These tools cover shapes, borders, and transforms that complement clip paths.
- CSS Triangle Generator – build triangles with the border technique as an alternative to clipping.
- CSS Border Radius Generator – round corners for elements that stay rectangular.
- CSS Transform Generator – rotate and scale clipped shapes.
- CSS Background Generator – fill clipped shapes with colour and gradients.
- CSS Filter Generator – apply blur and colour effects to shaped elements.