Skip to main content

developer tool

CSS Clip Path Generator

Create custom CSS shapes with twenty editable presets, draggable polygon points, precise numeric controls and local image clipping. Preview real clip-path rendering and copy matching CSS and HTML.

Loading tool…

Guide

CSS Clip Path Generator online

Choose a shape, adjust its coordinates and inspect the result as native browser CSS. This Visual Clip Path Editor offers twenty editable presets, an SVG polygon editing guide and separate controls for circle, ellipse and inset functions. The final preview applies the same clip-path string that you copy. Optional images are validated and prepared locally; their bytes are never sent to an image processing server.

How to Use the CSS Clip Path Generator

1

Choose an editable shape

Start with Triangle, Hexagon, Star or another preset. Choose polygon, circle, ellipse or inset in Shape type to show the controls for that CSS function. Set a width and height for the preview box.

2

Customize the coordinates

For polygons, drag the numbered handles or select a point and enter X/Y percentages. Add inserts a point into the next edge; remove keeps at least three points. Other shape types expose radius, center or inset controls instead.

3

Preview color or a local image

Choose a solid color, two-color gradient or a JPEG, PNG or WebP image. Use cover or contain without stretching the image. A checkerboard reveals the clipped-away area around the shape.

4

Copy and integrate

Copy just the clip-path declaration, complete CSS, HTML or the combined example. Image examples use a placeholder path that you replace. Reset restores the default triangle and releases the local image preview.

What CSS Clip-path Does

clip-path defines the region of an element that remains visible. Paint outside that region is clipped, including the element's background and descendants. Its normal-flow layout box retains its original dimensions. This CSS Clip Path Maker uses polygon(), circle(), ellipse() and inset() basic shapes; it does not convert your element into an SVG or destructively crop an image. The actual preview is a clipped HTML element, while SVG is used only for editing polygon coordinates.

How Polygon Coordinates Work

polygon() joins an ordered list of X/Y pairs and closes the last edge back to the first point. X percentages measure across the reference box; Y percentages measure down it. For example, 0% 0% is the upper-left corner and 100% 100% is the lower-right. The CSS Polygon Generator preserves your list order instead of sorting by position. Crossing edges can make self-intersections under CSS's default nonzero fill rule. Dragging, numeric edits and point insertion all update the same state.

Creating a Triangle with CSS

A triangle needs three non-collinear points. The Triangle preset uses 50% 0%, 100% 100% and 0% 100%, giving an apex at the top center and a full-width base. Select each point to move it, or change width and height to make the triangle broader or taller. This CSS Triangle Generator retains at least three points. You can still place points on top of each other; a zero-area result can disappear until you move them apart.

Creating Hexagons and Stars

The Hexagon preset supplies six ordered vertices around the center. The Star preset alternates five outer tips and five inner corners, for ten points in total. Both remain editable in this Clip Path Polygon Generator. The regular polygon presets use equal angular spacing in normalized coordinates; a non-square box stretches their physical appearance. Use equal width and height for a balanced hexagon or star, then adjust individual points to create an intentionally asymmetric shape.

Circle and Ellipse Clipping

circle() takes a radius and center position; ellipse() has separate horizontal and vertical radii. This CSS Shape Generator uses percentages for all of these controls. Ellipse radii resolve against width and height respectively. A circle's percentage radius resolves against the normalized diagonal of the reference box, so circle(50%) on a rectangular box may extend past its shorter edges. Choose a square preview for a centered circle that touches all four sides. Zero radii can collapse the visible region.

Inset Clipping and Rounded Corners

inset() moves the clip boundary inward from the top, right, bottom and left edges. Link sides to edit them together or unlink them for an asymmetric crop. The optional round clause adds a corner radius in pixels. The preview follows native CSS behavior when opposite inset percentages total 100% or more, which can collapse an axis. Large corner radii are normalized by CSS to fit the remaining region. Turning rounding off omits the round clause entirely.

Using Clip-path with Images

CSS Image Clipping keeps the original image intact and hides pixels outside a CSS shape at display time. Upload one JPEG, PNG or WebP up to 10 MiB and 20 megapixels, with neither side exceeding 16,384 pixels. Actual bytes, metadata and decoding are checked locally. A still PNG preview is prepared at up to 1,600 pixels per side; animated sources show one frame. Cover crops to fill the box, while contain shows the full image with backing-color gaps. Copied HTML uses your-image.jpg, never a temporary blob URL. Replace that path and write appropriate alternative text.

Making Responsive Clip-path Shapes

Percentage polygon coordinates respond to the element's current width and height, so the outline scales when its box changes. Different width-to-height ratios can stretch the shape. The complete demo exports the fixed dimensions shown in the preview; replace them with responsive width and aspect-ratio rules when integrating into a layout. A pixel inset corner radius stays physically fixed as the box scales. Review shapes at narrow widths with real content rather than assuming clipping will protect text from being cut off.

Clip-path vs Border-radius

border-radius rounds an element's box corners. clip-path can describe triangles, stars, slanted edges and other silhouettes with inner and outer corners. The two properties can affect the same element, but they solve different geometry problems. For an ordinary rounded card, use the related Border Radius Generator. For a custom silhouette, begin with a polygon preset here. Both retain the element's layout box; neither automatically reflows text to follow a polygon outline.

Browser Compatibility and Accessibility

Support for the four basic shapes depends on the browser and version in which your page runs. Test the exported declaration in your target browsers and keep a usable unclipped fallback when needed. This Online CSS Clip Path Tool provides keyboard-focusable handles, arrow-key nudging, numeric coordinate alternatives and labeled controls. Avoid clipping essential text or focus indicators in your own design. Clipping can affect hit testing but does not replace meaningful HTML, accessible names or image alternative text. No preview animation is added.

Editing and Reusing the Generated CSS

The clip-path declaration is serialized from bounded numeric fields and validated colors rather than arbitrary pasted CSS. Complete CSS includes the same dimensions, fill, clipping, image fit and surrounding preview surface used by the tool. Use the combined HTML/CSS example for a standalone demo, then adapt the class names and image path for your page. The polygon editor supports 3 to 30 points with insertion after the selected point. This CSS Star Shape Generator exports CSS and HTML only; it does not export a clipped PNG or an SVG path.

Common uses for CSS Clip Path Generator

  • Creating a slanted section background
  • Clipping a photo to an editable hexagon
  • Making a CSS star or arrow silhouette
  • Comparing polygon coordinates across box sizes

Why use this developer tool?

  • Edit twenty real shape presets with native CSS previewing.
  • Drag polygon points or use precise keyboard and numeric controls.
  • Preview local image clipping without uploading image bytes.
  • Copy a declaration or a matching complete HTML/CSS demo.

CSS Clip Path Generator FAQ

What is CSS clip-path?

It defines the visible region of an element. Pixels outside the chosen basic shape are clipped while the original layout box remains unchanged.

How do I create a triangle using CSS?

Use polygon(50% 0%, 100% 100%, 0% 100%). The Triangle preset loads those three points so you can move them and adjust the box dimensions.

How do I create a hexagon in CSS?

Use polygon() with six vertices around the box. Choose Hexagon here to load six editable points, then use equal width and height for balanced proportions.

How do I create a star shape with CSS?

Choose Star to load a polygon alternating five outer tips and five inner corners. All ten points can be dragged or edited numerically.

What does polygon() do in CSS?

It connects ordered X/Y coordinate pairs and closes the final edge back to the first point. Percentages let the outline scale with the reference box.

Can I use clip-path on images?

Yes. Select Image fill and choose a supported local file. Cover or contain preserves its aspect ratio. The original file stays unchanged and copied HTML uses a replaceable image path.

How do I edit polygon points?

Drag a numbered SVG handle, focus it and use arrow keys, or select its point button and enter X/Y percentages. Add inserts after the selected point; remove retains at least three points. The limit is thirty.

Is CSS clip-path responsive?

Percentage coordinates scale with the element's dimensions. The generated demo uses your fixed preview dimensions; adapt those to responsive sizing and check how a changed aspect ratio affects the shape.

What is the difference between clip-path and border-radius?

border-radius rounds box corners; clip-path defines a more general visible silhouette such as a triangle, star or slanted polygon. Neither changes the normal-flow layout box to match the outline.

Is the CSS Clip Path Generator free?

Yes. All twenty presets, four shape types, polygon editing, local image preview and CSS/HTML copy actions are free without signup.

Related Tools