Skip to content

Border Radius Generator

Drag the dots, or tab to one and use the arrow keys
Fill
Unit
Top left
Top right
Bottom left
Bottom right
border-radius: 24px;

Shortest form · works in every browser, no -webkit- prefix needed

    Presets One click to load, then fine-tune

    CSS Border Radius Generator for Rounded Corners and Blob Shapes

    What is border-radius?

    border-radius is the CSS property that rounds the corners of a box. Every card, button, avatar and input with soft corners uses it. A small value like 6px takes the sharp edge off, a big one like 9999px turns a button into a pill, and 50% on a square makes a circle.

    This generator lets you drag the corners on a real box and copies the shortest CSS for you. Here are five shapes made with nothing but border-radius:

    Square 0
    Rounded 16px
    Pill 9999px
    Circle 50%
    Blob 30% 70% 70% 30% / 30% 30% 70% 70%

    How to Use It, Step by Step

    Five quick steps. Everything happens in your browser, and your last shape is remembered for next time.

    Step 1 Pick a Preset or Start From Scratch

    Click a tile under Presets: Rounded, Pill, Circle, Leaf, Tab top, Egg, three blobs, or Random blob for a new shape on every click. Already have a value in your stylesheet? Click Paste CSS, paste it (a value, a border-radius: line or a whole rule from your stylesheet) and press Load. Other properties in the rule are skipped and listed.

    Step 2 Drag the Corners

    Drag the dark dots on the preview, or use the sliders and number boxes on the left. Tab to a dot and the arrow keys move it one step at a time (hold Shift for ten). With Link all corners on, every corner follows. Turn it off to round just the corners you want.

    Step 3 Choose px, % or rem

    Switch the Unit and the values are converted so the shape stays the same where it can. px is right for most buttons and cards, % for circles and blobs that should stretch with the box. More on that below.

    Step 4 Go Advanced for Oval Corners and Blobs

    Switch to Advanced at the top and each corner gets two values: a horizontal radius (↔) and a vertical radius (↕). The dots move to the edges of the box, where each one marks the point where the curve starts. That’s how organic blob shapes are made.

    Step 5 Check It, Then Copy

    Change the box’s Width and Height to see how the corners behave on your real element, try a gradient, a picture or a solid color, and turn on a Border. Then press Copy. Pick Longhands for one line per corner, or Tailwind for classes like rounded-2xl or rounded-t-lg.

    💡 The notes under the code tell you when the browser will shrink your corners, when a circle won’t be round, and when you need overflow: hidden.

    The Shorthand Order: Clockwise From the Top Left

    Like margin and padding, border-radius takes one to four values. Four values go clockwise, starting at the top-left corner. Fewer values are copied to the missing corners:

    border-radius: top-left top-right bottom-right bottom-left;

    One value

    border-radius: 24px;

    All four corners get the same radius. This is what you want most of the time.

    Two values

    border-radius: 24px 0;

    The first is for top-left and bottom-right, the second for top-right and bottom-left (opposite corners match).

    Three values

    border-radius: 24px 0 8px;

    Top-left, then top-right and bottom-left together, then bottom-right. You’ll rarely need this one.

    Four values

    border-radius: 4px 16px 32px 48px;

    One per corner, clockwise from the top left: top-left, top-right, bottom-right, bottom-left.

    💡 Each corner also has its own property: border-top-left-radius, border-top-right-radius, border-bottom-right-radius and border-bottom-left-radius. They’re handy when you only want to change one corner of a box that already has a radius.

    px or %? What the Units Do

    A px radius always draws the same curve. A % radius is measured against the box itself: the horizontal part against the width and the vertical part against the height. Same box, same number, different unit:

    px: the curve keeps its size

    border-radius: 24px;

    A 24px corner is a 24px corner on a small button and on a huge card. Best for UI elements.

    %: the curve follows the box

    border-radius: 24%;

    Horizontal radius = 24% of the width, vertical = 24% of the height. On a wide box the corners turn oval.

    rem works like px but is measured in root font sizes (1rem is 16px unless someone changes their browser’s text size). Use it if the rest of your spacing is in rem.

    How to Make a Circle

    Make the box square and set the radius to half its size. 50% does that for any size, so you don’t need to work out the numbers:

    width: 96px;
    height: 96px;
    border-radius: 50%;

    If the box isn’t square, the same 50% gives you an oval (the second shape). Add aspect-ratio: 1 when only the width is known.

    How to Make a Pill Button

    Give the button a radius much bigger than it can ever be tall. The browser can’t fit corners that big, so it shrinks them until each end is a half circle, whatever the height:

    padding: 10px 22px;
    border-radius: 9999px;

    50% looks like it should work, but on a wide button it draws an oval. For a full button with colors and hover styles, try the HTML Button Generator.

    Rounded Images and Avatars

    border-radius works on <img> directly. For round avatars, add object-fit: cover so a photo that isn’t square fills the circle instead of getting squashed:

    img.avatar {
      width: 96px;
      height: 96px;
      border-radius: 50%;
      object-fit: cover;
    }

    Oval Corners With the Slash

    Put a / in the value and each corner gets two radii: the values before the slash are the horizontal radii, the values after it are the vertical ones. That turns each corner into part of an ellipse. This is what the generator’s Advanced mode writes.

    Wide, flat corners

    border-radius: 48px / 16px;

    Each corner is 48px wide and 16px tall.

    Tall, narrow corners

    border-radius: 16px / 48px;

    The same idea the other way around.

    An oval lens

    border-radius: 100% 0 / 100% 0;

    Two big oval corners meet in the middle.

    Blob Shapes

    Organic blobs are just eight % values: four horizontal radii, a slash, four vertical ones. When the two corners on each edge add up to 100%, the curves meet without a flat part, which is what makes them look soft and round. Click Random blob in the presets for new ones, and animate between two blobs with a CSS transition for a gentle “breathing” effect.

    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    border-radius: 73% 27% 59% 41% / 57% 59% 41% 43%;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;

    Rounding Only One Side or One Corner

    Set the corners you want square to 0. A few shapes you’ll use a lot:

    Top only (tabs, card headers)

    border-radius: 16px 16px 0 0;

    Perfect for a tab or the top of a card with a square image below it.

    Left side only

    border-radius: 16px 0 0 16px;

    Handy for the first button in a button group.

    One corner (chat bubble)

    border-radius: 20px 20px 20px 4px;

    Three round corners and one almost-square one point at the speaker.

    Common Mistakes

    Rounded card, square content

    The card has round corners, but the image or colored header inside it is still a rectangle and pokes out. Add overflow: hidden to the rounded card so the inside is clipped to the curve.

    50% on a rectangle

    50% only makes a circle on a square. On a rectangle it makes an oval, and on a wide button it makes a flat egg shape instead of a pill. Use 9999px for pills and keep circles square.

    Forgetting the unit

    border-radius: 10; is ignored completely, because only 0 may go without a unit. Write 10px. Negative values are ignored too.

    Border radius on a table

    A table with border-collapse: collapse ignores border-radius. Use border-collapse: separate with border-spacing: 0, or round a wrapper <div> with overflow: hidden instead.

    What This Generator Can’t Do

    Next steps: add depth with the CSS Box Shadow Generator (shadows follow your rounded corners), fill the shape with the CSS Gradient Generator, pick exact colors with the HTML Color Picker, or build a whole button in the HTML Button Generator.

    Frequently Asked Questions

    What does border-radius do in CSS?

    It rounds the corners of an element’s box. border-radius: 12px gives every corner a curve with a 12px radius, and the background, the border, the box-shadow and the outline all follow that curve. It doesn’t change the element’s size and doesn’t move anything else on the page.

    What order do the four border-radius values go in?

    Clockwise from the top left: top-left, top-right, bottom-right, bottom-left. So border-radius: 20px 20px 0 0 rounds only the two top corners. With two values the first is for top-left and bottom-right and the second for top-right and bottom-left. With three values the middle one is used for both top-right and bottom-left.

    How do I make a circle with CSS?

    Give the element the same width and height and set border-radius: 50%. For example width: 120px; height: 120px; border-radius: 50%. If the box isn’t square, 50% gives you an oval instead, because % is measured against the width for the horizontal radius and the height for the vertical one. aspect-ratio: 1 is a handy way to keep the box square.

    How do I make a pill-shaped button?

    Use a radius bigger than half the button’s height, like border-radius: 9999px. When the corners don’t fit, the browser shrinks them all by the same amount until they do, so each end becomes a perfect half circle whatever the height is. Don’t use 50% for this: on a wide button it makes an oval, not a pill.

    Should I use px, % or rem for border-radius?

    Use px (or rem) for normal rounded corners on cards, buttons and inputs, because the curve stays the same size when the box grows. Use % when the shape should follow the box, like a circle (50%) or a blob. rem works like px but grows with the user’s font size setting, which is nice if your spacing is in rem too.

    What does the slash (/) in border-radius mean?

    It lets each corner have a different horizontal and vertical radius, which makes the corner part of an ellipse instead of a circle. The values before the slash are the horizontal radii and the values after it are the vertical ones, both in the usual top-left, top-right, bottom-right, bottom-left order. border-radius: 30% 70% 70% 30% / 30% 30% 70% 70% is a well-known blob shape.

    How do I round only one side or one corner?

    Set the other corners to 0 in the shorthand, like border-radius: 16px 16px 0 0 for the top side only, or use a longhand such as border-top-left-radius: 16px for one corner. In the generator, turn off Link all corners and change just the corners you want.

    Why does the content stick out of my rounded box?

    border-radius rounds the box’s own background and border, but a child with its own background (an image, a header bar, a video) is still a rectangle and can poke out of the corners. Add overflow: hidden to the rounded parent so everything inside is clipped to the curve, or put the same radius on the child.

    Do I still need -webkit-border-radius?

    No. Every browser in use today supports plain border-radius, and has for well over ten years. The -webkit- and -moz- versions only mattered for browsers from around 2010, so the generator leaves them out.