Border Radius Generator

Pick a shape such as Pill, Leaf or Blob, then set each corner. Tick Elliptical corners to give a corner a different radius across and down.

How it works

border-radius rounds the corners of an element's box. Each corner is a quarter of a circle, or a quarter of an ellipse when its horizontal and vertical radii differ.

The shorthand lists corners clockwise from the top left: top left, top right, bottom right, bottom left. When some values repeat, CSS lets you leave them out, and this tool writes the shortest form that means the same thing. 12px 4px 12px 4px becomes 12px 4px.

For elliptical corners, CSS writes the four horizontal radii, a slash, then the four vertical radii. That is the eight-value form, such as 30% 70% 70% 30% / 30% 30% 70% 70%.

Percentages are measured against the box: horizontal radii against its width and vertical radii against its height. Switch the preview between wide, square and tall to see what that does to the same value.

How to use it

  1. 1 Pick a starting shape from the presets.
  2. 2 Untick Same on every corner to set each corner on its own.
  3. 3 Tick Elliptical corners to give each corner a separate radius across and down.
  4. 4 Choose pixels or percent, then press Copy CSS.

Good to know

  • For a pill, use a huge pixel value such as 9999px rather than 50%. On a wide box, 50% gives oval ends; a huge value gives true half circles.
  • 50% on a square makes a circle. On a rectangle it makes an ellipse.
  • Rounded corners clip the element's background and border, but not its children. Add overflow: hidden if an image inside pokes out of the corners.
  • For irregular organic shapes, the eight-value form with percentages is the trick behind most CSS blob generators.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Why 9999px makes a perfect pill and 50% does not

Take a button 300 pixels wide and 100 pixels tall. Give it border-radius: 50%. Horizontal radii are measured against the width and vertical radii against the height, so each corner becomes a quarter ellipse 150 pixels across and 50 pixels down. Four of those meet in the middle of each side, and the whole button turns into one big ellipse. It looks like a lozenge, not a pill.

Now give the same button border-radius: 9999px. Each corner asks for a circle 9999 pixels in radius, which plainly cannot fit. The CSS specification handles this with one rule: for each side, divide its length by the sum of the two radii that touch it, take the smallest of those ratios, and multiply every radius by it. The left side is 100 pixels long and carries two radii of 9999, a sum of 19998, so its ratio is 100 / 19998, about 0.005. The top side is longer, so its ratio is larger. The smallest ratio wins, and every radius becomes 9999 × 100 / 19998, which is 50 pixels.

Fifty pixels is exactly half the height, so each end of the button is a true half circle and the long sides stay straight. That is the pill shape, and it is why 9999px, or any value larger than the element will ever be, is the usual way to write it. It also keeps working if the button grows taller, where a fixed 50px radius would not.

The same scaling explains the eight-value form. The Blob preset writes 30% 70% 70% 30% / 30% 30% 70% 70%. Across the top, the top left corner takes 30% of the width and the top right 70%, which adds up to exactly 100%, so the two curves meet with no straight part between them. The same happens down each side. With every side fully curved and each corner a different ellipse, the box becomes a smooth, lopsided blob. Change any number and the browser rebalances the shape.

The limits. border-radius only shapes the box's own background, border and shadow; child elements are not clipped unless you add overflow: hidden. Percent values change shape when the box changes size, which is a feature for blobs and a surprise for cards. And a very thick border with a small radius gives a square inner corner, because the inner radius is the outer radius minus the border width.

Frequently asked questions

What does the slash in border-radius mean?

Values before the slash are the horizontal radii of the four corners; values after it are the vertical radii. Without a slash, each corner uses the same value both ways, which makes circular corners.

Why does 9999px not make a huge curve?

When the radii on one side add up to more than that side is long, the browser scales every radius down by the same factor until they fit. So 9999px on a 100px tall box ends up as 50px, exactly half the height.

Which corner comes first?

The top left, then clockwise: top right, bottom right, bottom left. With two values, the first is for top left and bottom right, the second for top right and bottom left.

Is anything uploaded?

No. The CSS is written by code running in this page.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.