CSS Border Radius Generator

Round corners individually or together and copy the border-radius CSS.

Presets:

Rounded
Pill
Circle
Leaf
Egg
Speech bubble

Top left

24

Top right

24

Bottom right

24

Bottom left

24

Preview width

260px

Preview height

180px

Used in the generated code, e.g. .box

24px

CSS
.box {
  border-radius: 24px;
}

CSS Border Radius Generator

Drag a slider for each corner – or link them to change all four at once – and copy the border-radius declaration. Presets create the most requested shapes in one click: rounded card, pill button, circle, leaf, egg, and speech bubble.

How the shorthand works

border-radius accepts one to four values, starting at the top-left corner and moving clockwise:

Values Meaning
12px all corners
12px 4px top-left & bottom-right, top-right & bottom-left
12px 4px 8px top-left, top-right & bottom-left, bottom-right
12px 4px 8px 0 each corner clockwise

The generator always prints the shortest form that produces your shape.

Elliptical corners

Turn on Elliptical corners to set a separate vertical radius. The value then gets a slash: horizontal radii before it, vertical radii after it – for example 50% / 60% 60% 40% 40%, which turns a rectangle into an egg. This is also the trick behind CSS-only blob shapes.

px, %, or rem?

  • px keeps the same curve on every element size – best for buttons and cards.
  • % is relative to the element's width and height. 50% on a square makes a perfect circle; on a rectangle it makes an ellipse.
  • rem scales with the root font size, so corners grow with the user's text settings.

For a pill button, use a large pixel value such as 999px; browsers cap the radius at half of the shorter side, so the ends are always perfectly round.

Vendor prefixes

All current browsers support the unprefixed property. The optional -webkit- and -moz- lines are only useful for very old Android and Firefox versions.

Frequently Asked Questions

Give the element the same width and height and set border-radius: 50%. The Circle preset does exactly that.

Values before the slash are horizontal radii and values after it are vertical radii. Different values create elliptical rather than circular corners.

Browsers scale overlapping radii down so curves never overlap. Any value above half of the element height already produces a fully rounded pill.