Pick a shape, type its points or edges in percent, check the cut in the preview and copy the clip-path line.
FluffyShieldProtected workspace
Loading the tool…
The tool didn't load. Reload the page, or check whether an extension or network filter blocks .
Free · No upload · No sign-up · No usage quotas
Why does my clip-path hexagon come out squashed?
Because its points are measured on your element's box. The same six numbers make a fat hexagon on one box and a thin one on the next.
FluffyBench · 4 min read · Reviewed
Each point is a spot on the element's box
You've found a hexagon for a profile picture, written as clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);, and pasted it onto your square avatar. Out comes a hexagon squeezed from side to side, with a short flat top and long sloping sides. Nothing is wrong with the line. It's doing what its numbers say, on a box they weren't written for.
Every pair in the list is one corner, given as two percentages: how far across the box, then how far down it. The measuring starts from the box's top-left corner, so 25% 0% is a quarter of the way across, on the top edge, and 75% 0% is three quarters across on the same edge. The second number counts downward, the opposite way to a graph at school.
The points are pins in a rubber sheet stretched over the box: the first number is a share of the element's own width, the second a share of its own height. Make the box wider and the pins move apart sideways, but not up and down, so the shape stretches with it.
The box shape that gives six even sides
In the preview
On a square
On 139 by 120
One clip-path line on three boxes, drawn to one scale. Compare the flat top edge with the slanting sides. How we worked it out
In the tool's preview, which cuts the shape from a box 160 by 120 pixels, the flat top of the hexagon is 80 pixels long and each slanting side 72.1. On a 120 by 120 square the top shrinks to 60 and the slants grow to 67.1. That's the squeezed hexagon on the avatar.
The six sides come out equal only when the box is about 1.15 times as wide as it is tall. On 139 by 120 pixels the top is 69.5 and the slants 69.3, the same to within a fraction of a pixel.
So there are two ways to an even hexagon: give the element that shape, or keep the element and move the points. On the square avatar, an even hexagon is a little shorter than the box, so its top and bottom come in from the edges: clip-path: polygon(25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%, 0% 50%); Each side is then 60 pixels.
The order of the points is the order of the outline
The outline runs from each point to the next one in the list, and from the last back to the first. The box above takes 3 to 12 points.
With the second and third points swapped the line reads clip-path: polygon(25% 0%, 100% 50%, 75% 0%, 75% 100%, 25% 100%, 0% 50%);. The edge now runs from the top left over to the right-hand corner, back up to the top, then straight down, cutting across its own first stroke. List the corners as you'd trace them with a finger, going round the shape one way.
Typing the avatar's hexagon into Polygon
These steps build the even hexagon for the square avatar. The tool opens on Inset, a rectangle trimmed in from its four edges, so the shape has to be switched first.
Choose Polygon under Shape.
Press Add point twice, until the list reaches Point 6.
Type the hexagon's six points into Points 1 to 6, X first, then Y: 25 6.7, 75 6.7, 100 50, 75 93.3, 25 93.3, 0 50.
Press Copy CSS on the CSS box.
Copy CSS gives you the square avatar's line. For a box about 1.15 times as wide as it is tall, type 0 and 100 in place of 6.7 and 93.3, which gives back the line the avatar started with.
If a cut-out on the page isn't quite the job
The hexagon should be filled with a blend of colors
clip-path cuts whatever the element paints. The CSS generator's Gradient mode writes the background-image line for the blend, and both lines go in one rule.
You need the photo itself cut down, as a file to send