HandyBench

CSS Border Radius Generator

Round corners and copy the border-radius CSS.

Preview of a 300px square, scaled down

border-radius: 20px;

How to use the CSS Border Radius Generator

  1. 1 Drag the slider to round all corners together, or unlink to set each corner.
  2. 2 Watch the live preview update.
  3. 3 Copy the generated border-radius CSS.

Corner order and shorthand

The border-radius shorthand starts at the top-left corner and moves clockwise: top-left, top-right, bottom-right, bottom-left. This tool follows that order. When all four sliders match it writes one value; otherwise it writes four.

border-radius: 20px;
border-radius: 40px 0px 40px 0px;

Each slider runs from 0 to 150 px, and values are always pixels. The CSS property also accepts percentages, other units, two-to-three value shorthands and an elliptical form with a slash such as 50% / 30%. This tool does not produce those, so edit the output by hand for ellipses.

Worked example: the clamping rule

Radii cannot overlap. If the two radii along one side add up to more than that side's length, the browser multiplies every radius by the same factor so they just fit. Take a 100 px square with 80px on every corner: each side needs 160 px but has 100, so the factor is 100 divided by 160, which is 0.625, and all four corners render at 50 px. That is a circle.

The preview shows a 300 px square drawn at about 43 percent scale (radii are scaled by the same factor), so every value from 0 to 150 px looks different and 150 px gives a full circle. In your real layout the cutoff where radii start to clamp depends on your element's size.

GoalValueNote
Circle50% on a square elementPercentages follow element size; pixel values do not
Pill buttonAny radius of at least half the heightFor example 9999px; clamping handles the rest
Leaf shape0 50% 0 50%Opposite corners rounded, the other two sharp
Chat bubbleThree large corners, one at 0The sharp corner points at the speaker

Gotchas

  • Images and children. Rounding a box does not clip its contents. Add overflow: hidden to the box, or put the radius on the image itself.
  • Nested rounding. An inner element inside a padded rounded card looks best with a radius equal to the outer radius minus the padding, otherwise the gap between curves looks uneven.
  • Sizing in rem. If the rest of your layout scales with the root font size, convert with the px to rem converter.

Examples

  • ▸ Pill-shaped buttons with a large uniform radius.
  • ▸ A card with a single rounded corner for a chat-bubble look.

Frequently asked questions

Can I round each corner differently?

Yes. Turn off “Link all corners” to set the top-left, top-right, bottom-right and bottom-left radii independently. The tool outputs the four-value shorthand.

How do I make a perfect circle or pill?

For a circle, set border-radius to 50% on a square element. For a pill button, use a radius at least half the element’s height (a large px value works too).

In what order are the four values written?

Clockwise from the top-left: top-left, top-right, bottom-right, bottom-left. When all four corners match, the tool writes a single value instead.

Why does a large radius turn into a circle in my real layout?

CSS shrinks radii proportionally when two corners on one side would overlap, so on a small element a large radius clamps to a circle. The preview represents a 300 px square drawn at reduced scale, so each value up to 150 px looks different there.

Does this make elliptical corners?

No. It writes pixel values only, which give circular corners. For an elliptical corner, edit the copied code to use the slash syntax, for example border-radius: 50% / 30%.