CSS Border Radius Generator

Round the corners of a box together or one by one and copy the border-radius CSS. Work in px, % or rem, see the shape live, and get the shortest shorthand plus the Tailwind class, using a named class like rounded-lg when your value matches one.

Preview background
Unit

50% on a square makes a circle; 9999px on a rectangle makes a pill. The shorthand order is top left, top right, bottom right, bottom left.

Code
border-radius: 24px;

Generating runs in your browser. What you type never leaves this device.

Features

  • All corners at once, or each corner separately

  • px, % and rem units

  • Shortest valid shorthand (one, two, three or four values)

  • Tailwind output: rounded-lg, rounded-2xl and so on when the value matches, otherwise rounded-[...]

  • Preview in your colour on light, dark and transparent backgrounds

Common shapes

Cards and images

8 to 16 px corners make cards and photos feel friendlier.

Pills and circles

A very large radius makes pill buttons and tags; 50% on a square makes a circle avatar.

Chat bubbles and tabs

Round three corners and leave one square for speech bubbles; round only the top for tabs.

Reading border-radius

The shorthand order

  • One value: all four corners.
  • Two values: top-left and bottom-right, then top-right and bottom-left.
  • Three values: top-left, then top-right and bottom-left, then bottom-right.
  • Four values: top-left, top-right, bottom-right, bottom-left (clockwise from the top left).

px, % or rem?

px keeps corners the same at every size, which suits buttons and cards. % is relative to the box, so 50% always gives a circle or an ellipse. rem scales with the root font size, useful in design systems that size everything in rem.

Nested corners

When a rounded box sits inside another with padding, the inner radius should be the outer radius minus the padding. Otherwise the corners look uneven.

Related tools

CSS Border Radius Generator - FAQ