CSS border radius generator
Round each corner on its own in pixels or percent, or switch to blob mode and shape organic forms with eight values. See it live and copy the CSS. Free, and it runs in your browser.
How to use it
- Choose Four corners and set each corner, picking px or % as the unit.
- Or choose Blob shape (8 values) and drag the horizontal and vertical sliders.
- Check the preview and click Copy on the CSS code.
Complete guide to CSS border-radius
What border-radius does
The border-radius property rounds the corners of any box: buttons, cards, avatars, images, inputs, badges. A small radius makes an interface feel precise, a large one makes it friendly, and 50% on a square turns it into a circle. The syntax looks simple until you need different corners or organic shapes, because the property accepts up to eight numbers and a slash. This generator lets you set each corner visually, see the shape at once and copy the exact CSS.
How the values are read
With four values, CSS reads the corners clockwise starting at the top left: top left, top right, bottom right, bottom left. This is the same order as the four fields of the tool. The shorthand shortens the list when corners repeat, and the tool writes the shortest form automatically.
| You write | Meaning |
|---|---|
8px | All four corners 8px |
0 50% | Top left and bottom right 0, top right and bottom left 50% |
4px 8px 12px | Top left 4, top right and bottom left 8, bottom right 12 |
4px 8px 12px 16px | Each corner on its own, clockwise |
40% 60% / 60% 40% | Horizontal radii before the slash, vertical radii after it |
Each corner is really an ellipse quarter with a horizontal and a vertical radius. When both are equal you get a circular curve. When they differ you get the soft, uneven outlines known as blob shapes. The Blob shape (8 values) mode exposes all eight radii as percentages between 0 and 100, four horizontal and four vertical.
Pixels or percent
Pixels stay constant, so a 12px radius looks the same on a small tag and on a large banner. Percent follows the size of the element: 50% on a square gives a circle, and on a rectangle gives an ellipse. In Four corners mode choose between Pixels (px) and Percent (%) under Unit (four corners mode). Percent values above 100 are rejected, and a corner set to 0 is written without a unit. The generated CSS uses only border-radius, so it works in every current browser.
Worked example
- In Four corners mode with Pixels (px), type 10, 20, 30 and 40 in Top left, Top right, Bottom right and Bottom left. The tool prints
border-radius: 10px 20px 30px 40px;. - Set the four fields to 24 (the default) and the result collapses to
border-radius: 24px;. - Switch the unit to Percent (%) and use 0, 50, 0, 50. The result is
border-radius: 0 50%;, a leaf-like shape with two sharp corners. - Choose Blob shape (8 values) and keep the sliders at their defaults. The result is
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;. Moving the horizontal sliders to 40, 60, 40, 60 and the vertical ones to 60, 40, 40, 60 givesborder-radius: 40% 60% / 60% 40% 40% 60%;.
Tips and common mistakes
- For a perfect circle use a square element and 50% on every corner. For a pill button use a very large pixel value, such as 999px: browsers shrink the radii so the curves never overlap.
- The preview size fields (Preview width (px) and Preview height (px)) only affect the demo box, not the CSS. Test the code on the real element, because percent radii depend on its proportions.
- Inner content is not clipped by the radius on its own. Add
overflow: hiddento the rounded box when an image or child element must follow the curve. - Radii cannot be negative.
Related tools
Combine rounded corners with depth using the box shadow generator, or fill the shape with the gradient generator. To convert pixel radii to relative units try the px to rem converter.
Questions
How does the blob shape work?
CSS accepts a horizontal and a vertical radius for each corner, written as four values, a slash, and four more values. Different horizontal and vertical radii turn circles into organic, uneven shapes.
When should I use % instead of px?
Percent scales with the element size, so 50% on a square gives a perfect circle at any size. Pixels stay fixed regardless of size.
Why is the CSS sometimes shorter than four values?
The tool uses the shorthand: one value when all corners match, two when opposite corners match, and so on. The result is the same, just shorter.
What happens if the radii are too large?
Browsers scale all radii down proportionally so the curves never overlap, so very large values simply produce a pill or circle.