CSS Border Radius Generator
Create rounded corners with CSS border-radius: set all corners at once or each one separately, in px, % or rem, and copy the shortest CSS.
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the CSS Border Radius Generator
- 1 Choose the unit and whether all corners share the same radius.
- 2 Drag the sliders and watch the preview.
- 3 Copy the border-radius declaration.
About the CSS Border Radius Generator
border-radius rounds the corners of an element's border box. One value rounds all four corners equally; four values set the top-left, top-right, bottom-right and bottom-left corners in that order, clockwise from the top left.
The generator writes the shortest shorthand that gives the same result: one value when all corners match, two values when opposite corners match, and three or four values otherwise. Units can be px for fixed corners, % to scale with the element's size, or rem to scale with the font size.
A radius of 50% on a square makes a circle, and on a rectangle an ellipse. For a pill shape (fully rounded ends), use a radius larger than half the height in px, such as 9999px, so the ends stay round at any width. Rounded corners also clip backgrounds and images, but not content overflowing the box unless you set overflow: hidden.
Frequently asked questions
How do I make a circle?
Give a square element border-radius: 50%.
What is the order of four values?
Top-left, top-right, bottom-right, bottom-left: clockwise, starting at the top left.
px or %?
px gives the same corner on any size; % depends on the element's width and height and can turn corners elliptical on rectangles.
Why doesn't the image inside get rounded?
Child elements aren't clipped by default. Add overflow: hidden to the parent, or give the image the same border-radius.