About the CSS Border Radius Generator
Rounded corners soften interfaces, and unusual combinations create pills, tabs, speech bubbles and organic blob shapes. This border radius generator sets one radius for all corners or each corner separately, supports elliptical radii with different horizontal and vertical values, and previews the shape as you drag. The CSS is written in the shortest correct shorthand, ready to copy into a stylesheet. Percentages adapt to the element's size, while pixel values stay fixed, and the preview lets you try both. Designers often combine a large radius on two corners with small ones on the others for chat bubbles and tags.
Turn on elliptical corners to give every corner its own horizontal and vertical radius. These eight values, written with a slash, create organic blob shapes, leaves, eggs and drops that are popular for avatars, image masks and decorative backgrounds. Presets for a rounded card, a pill, a circle, a blob, a leaf and a drop give you a quick start.
Choose pixels for fixed rounding that stays the same at any size, or percentages that scale with the element, which is how circles and ellipses are made. The longhand option writes the four corner properties separately, which is handy when you only want to override one corner in an existing rule. Resize the preview to check the result on wide and narrow shapes.
Combine rounded corners with depth from the box shadow generator, or style a complete button with the CSS button generator. To round the corners of a picture file itself, use the round image corners tool.
How to use the CSS Border Radius Generator
- Set the radiusDrag the slider to round all corners, or untick Link all corners to set each one.
- Pick the unitUse px for fixed rounding, or % for shapes that scale, like circles.
- Try elliptical cornersTick Elliptical corners to give each corner a horizontal and a vertical radius.
- Copy the CSSCopy the shorthand, or tick Longhand for the four separate properties.
CSS Border Radius Generator features
- One radius or four separate corners
- Elliptical radii for blob shapes
- px or % units
- Shortest correct shorthand
- Longhand output option
- Presets: card, pill, circle, blob, leaf, drop
- Resizable preview shape
- Tailwind arbitrary value
Common uses
- Rounding cards, inputs and buttons
- Making circular avatars and pill badges
- Creating blob shapes for hero sections
- Designing speech bubbles and tabs
- Learning the border-radius shorthand
Rounded corners in practice: a radius scale, nested corners, pills versus ellipses, images, tables and mobile form fields
Corner radius quietly shapes how an interface feels: small radii look precise and formal, large ones friendly and soft. The details matter too, from nested corners that do not line up to tables that refuse to round. This guide defines a radius scale for a design system and covers concentric corners, pill shapes, rounded images, tables, the default rounding mobile browsers apply to form fields and matching corners to a brand.
A worked example: a radius scale
A product team defines four radius values and uses them everywhere:
- Small, 4px: inputs, tags and checkboxes.
- Medium, 8px: buttons and cards.
- Large, 16px: dialogs and large image cards.
- Full, 9999px: pills, toggles and badges.
Stored as custom properties such as --radius-md: 8px;, the scale keeps components consistent and makes a future change, such as softening the whole interface, a matter of editing four lines.
Nested corners
When a rounded element sits inside another with padding, using the same radius for both makes the gap between them uneven at the corners. For concentric curves, the inner radius should be the outer radius minus the padding: a card with a 16px radius and 8px padding needs an 8px radius on the image inside. This small detail is one of the clearest signs of polished design.
Pills versus ellipses
Setting border-radius: 50% on a rectangle produces an ellipse, not a pill, because percentages refer to the width and height separately. A very large fixed value such as 9999px gives fully rounded ends on any rectangle, which is the reliable way to make pill buttons and tags. Fifty per cent remains right for circles, on square elements.
Rounded images
Avatars are usually square images with a 50 percent radius, combined with object-fit: cover so photos of any shape fill the circle without stretching. For rectangular image cards, round the container and let it clip the image, so the corners stay neat even before the image loads.
Rounded tables
border-radius has no effect on a table using border-collapse: collapse, a common source of frustration. Switching to border-collapse: separate with zero spacing, and placing the radius on the table or a wrapper with hidden overflow, produces rounded tables that keep their cell borders.
Form fields on phones
Safari on iPhones applies its own rounded corners and styling to some inputs and buttons. Adding appearance: none to form controls removes the default styling, so your own radius applies consistently across devices. Check select boxes and search fields, which are most affected.
Matching the brand
Corner style should match the brand's personality and its logo. A law firm or bank may prefer small radii, while a children's learning app or food delivery service suits generous rounding. Whatever the choice, consistency across buttons, cards and images matters more than the exact values.
Rounded corners and borders
When an element has both a border and a radius, the inner edge of the border has a smaller radius than the outer edge. With thick borders, very small radii can make the inside corner look square. Increasing the radius slightly, or using a thinner border, keeps both edges visibly rounded.
Common mistakes
- Using the same radius on nested elements.
- Using 50 percent on rectangles when a pill was intended.
- Expecting collapsed tables to show rounded corners.
- Letting each component invent its own radius.
Related tools
To crop images before rounding them, use Image Cropper. For gradient backgrounds on rounded cards, try CSS Gradient Generator, and to express radii in rem, PX to REM Converter.
Rounding only some corners
Tabs usually have rounded top corners and square bottoms, written as border-radius: 8px 8px 0 0, so they join the panel below. An input joined to a button rounds only the outer corners of the pair. Rounding the corners that face outward while keeping joined edges square makes grouped controls look like one piece.
Focus outlines follow the corners
Modern browsers draw focus outlines that follow an element's rounded corners, while older versions drew square outlines around rounded buttons. If your audience includes older browsers, check focus outlines on rounded controls; a focus ring made with a spread shadow follows the corners everywhere.
Status dots on round avatars
To place an online status dot exactly on the edge of a circular avatar at the lower right, position its centre about 14.6 percent of the avatar's width in from the right and bottom edges. That point lies on the circle at a 45-degree angle, so the dot looks attached to the avatar rather than floating beside it.
Auditing an existing site
Older stylesheets often contain dozens of slightly different radius values, such as 3, 4, 5 and 6 pixels, added by different people over time. Searching the stylesheet for border-radius and mapping each value to the nearest step of your scale tidies the design without anyone noticing a change, except that everything suddenly feels more consistent.
Privacy
Shapes are designed and previewed in your browser. Nothing is uploaded or stored.
Frequently asked questions
How does the border-radius shorthand work?
One value rounds all corners. Two values set top-left and bottom-right, then top-right and bottom-left. Three values set top-left, then top-right and bottom-left, then bottom-right. Four values go clockwise from top-left.
What does the slash in border-radius mean?
Values before the slash are horizontal radii and values after it are vertical radii, so each corner becomes a quarter of an ellipse instead of a circle. That is how blob, egg and leaf shapes are made with plain CSS.
How do I make a circle with CSS?
Give an element equal width and height and set border-radius to 50%. On a rectangle the same value gives an ellipse. For a pill shape with fully round ends, use a large fixed value such as 999px instead.
Should I use px or %?
Pixels keep the same rounding at any size, which suits buttons, cards and inputs. Percentages scale with the element, which suits circles, ellipses and blobs, but they can look uneven on long rectangles.
Why does my radius look smaller than I set?
When two neighbouring radii add up to more than the side they share, browsers scale all the radii down proportionally so they fit. The preview shows exactly what browsers will draw.
Does border-radius clip the content?
It rounds the background and the border. Child elements and images can still stick out of the corners; add overflow: hidden to the rounded element to clip them as well.
Is anything uploaded?
No. The preview and the CSS are produced by code running in this page on your own device. Nothing is sent to a server or stored.
Can I animate border-radius?
Yes. border-radius can be transitioned and animated with CSS, for example to morph a square button into a circle on hover, or to make a blob shape slowly change by animating between two sets of elliptical radii.