ZapKit

CSS Border-Radius Generator

Round corners visually, all together or one at a time, in pixels or percent, and copy the shortest border-radius CSS.

What is a border-radius generator?

A border-radius generator creates the CSS for rounded corners, one of the most common styling choices for buttons, cards, avatars and images. Uneven corners are harder to picture from numbers alone, which is where a live preview helps.

This generator rounds all four corners together or each separately, in pixels or percent, previews the shape, and writes the shortest equivalent border-radius shorthand. The settings live in the link, so a shape can be bookmarked or shared with whoever is building the component.

How to use the CSS Border-Radius Generator

  1. 1.Choose a unit

    Pixels for fixed corners, percent for corners that scale with the element.

  2. 2.Set the corners

    Keep them linked for even rounding, or unlink for shapes like tabs and speech bubbles.

  3. 3.Copy the CSS

    The shorthand is reduced to as few values as possible.

Example: shorthand reduction

Corner values (top-left, top-right, bottom-right, bottom-left) and the CSS written:

24, 24, 24, 24 px
border-radius: 24px
24, 0, 24, 0 px
border-radius: 24px 0
24, 24, 0, 0 px
border-radius: 24px 24px 0 0
50% on a square
a circle

The third shape, top corners only, is the classic browser-tab look.

How the shorthand works

border-radius takes one to four values, clockwise from the top left: one value for all corners; two for top-left/bottom-right and top-right/bottom-left; three for top-left, the top-right/bottom-left pair and bottom-right; four for each corner. The generator writes the shortest form that matches.

Percentages are relative to the element's width and height, so 50% on a square makes a circle and on a rectangle makes an ellipse. Pixel radii stay the same size however big the element gets.

Frequently asked questions

How do I make a circle?

Give a square element border-radius: 50%.

How do I make a pill-shaped button?

Use a pixel radius at least half the button's height, such as 9999px.

Can I round only the top corners?

Yes. Unlink the corners and set the bottom two to 0.

Does border-radius clip images inside?

Only if the element also has overflow: hidden, or you put the radius on the image itself.

More Developer tools