Design Tools
CSS Border Radius Generator
Set each corner of a CSS border-radius in px, %, rem or em, preview the shape live and get the shortest shorthand, plus the four longhand properties if needed.
How to use CSS Border Radius Generator
Enter a radius for the top left, top right, bottom right and bottom left corners and choose the unit. The preview and the border-radius code update as you type; tick the longhand option to get four separate properties too.
- Enter the four cornersType a radius for each corner; 0 gives a square corner. Values can't be negative.
- Choose a unitUse px, rem or em for fixed curves, or % of the element's size, from 0 to 100, for circles and ellipses.
- Copy the CSSCopy the shorthand, or tick the longhand option to add border-top-left-radius and the other three.
The clockwise order and how values merge
With four values, border-radius goes clockwise from the top left: top left, top right, bottom right, bottom left. The default 24, 24, 8, 8 gives border-radius: 24px 24px 8px 8px;. Matching values are merged into the shortest equivalent: one value when all corners match, two when top left equals bottom right and top right equals bottom left (0 10px), and three when only top right equals bottom left, as in 10px 20px 30px. Each corner gets a single radius; the slash syntax for elliptical corners isn't generated.
Common shapes
For rounded tops only, as on tabs and card headers, enter 16, 16, 0, 0 to get 16px 16px 0 0. For a circle, choose % and set all four corners to 50 on a square element; on a rectangle the same setting gives an ellipse. For a pill-shaped button, use px with a value larger than half the height, such as 9999. Percentages are measured against the element's width for the horizontal curve and its height for the vertical one, which is why they stretch on boxes that aren't square.
Accuracy and data handling
Review colours, dimensions and visual settings in the real component, type size and target display. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
What order are the four border-radius values in?
Top left, top right, bottom right, bottom left, going clockwise from the top left. In 10px 20px 30px 40px, the bottom right corner is 30px.
How do I make only the bottom corners square?
Set the bottom right and bottom left corners to 0. For example, 16, 16, 0, 0 gives border-radius: 16px 16px 0 0;.
How do I make a circle or a pill shape?
Choose % and set every corner to 50 for a circle on a square element. For a pill, use px and a value bigger than half the element's height, such as 9999.
More Design Tools
Related toolsCalculate PPI, pixel pitch and physical size from a screen's resolution and diagonal.
Pick or paste a colour and get HEX, RGB, HSL, HWB, HSV and CMYK codes at once.
Create linear, radial and conic CSS gradients, including gradient text, with a live preview.
Make a 50–900 colour scale or a colour-wheel scheme and export it as CSS, SCSS or Tailwind.
Get the WCAG contrast ratio, AA and AAA results and the nearest passing text colour.
Convert HEX to RGB and RGB to HEX, one colour or up to 200 at a time.