How to use this Border Radius Generator
Move each slider to adjust the radius of a specific corner. The live preview updates
automatically so you can see the shape instantly. When the result looks right, copy the CSS
and paste it into your stylesheet or component.
- Adjust top-left, top-right, bottom-right, and bottom-left values.
- Preview the rounded shape live.
- Copy the generated border-radius CSS.
- Paste the code into your project.
Example output
border-radius: 24px 24px 24px 24px;
Common use cases
- Buttons and CTAs
- Cards and tiles
- Inputs and form fields
- Containers and panels
- Avatars and media blocks
Every corner is an ellipse, not an arc
The mental model most people carry — that border-radius sets the size of a
quarter-circle in each corner — is only half the property. Each corner actually has
two radii: one horizontal and one vertical. When they are equal you get a
circular arc; when they differ you get an ellipse. The slash syntax exposes both. In
border-radius: 50% / 30%, the value before the slash sets all four
horizontal radii and the value after sets all four vertical radii, so each
corner bulges wider than it is tall.
This is the mechanism behind the "blob" and "leaf" shapes you see in modern UI. Give the two
sides of the slash different multi-value lists — for example
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70% — and each corner gets its own
asymmetric ellipse, producing an organic, hand-drawn silhouette out of a plain rectangle. A
four-corner tool that only offers one number per corner cannot express these; you need the
horizontal-and-vertical pair per corner to build them.
Percentages are relative to the box's own size
A percentage radius is measured against the box's dimensions — the horizontal radius against
the width, the vertical radius against the height. That has two consequences worth
internalising. First, border-radius: 50% turns a square into a perfect
circle, but on a rectangle it produces an ellipse, because 50% of a wide width is a larger
radius than 50% of a short height.
Second, this is why a pill button uses a big pixel value rather than a percentage.
border-radius: 50% on a wide, short button gives you an oval, not a stadium
shape. The reliable pill is a length larger than half the element's height —
border-radius: 9999px is the common idiom. It reads as "round the ends as much
as geometrically possible," and because browsers clamp any radius that would overflow, the
corners settle at exactly half the height no matter how tall the button grows. That makes it
robust to font-size and padding changes in a way a hardcoded 20px is not.
Why your radius quietly gets smaller than you set
Set border-radius: 80px on a box that is only 100px tall and put a different
large radius on the corner below it, and you will find the rendered corners are smaller than
80px. This is not a bug. When the radii of two corners that share an edge add up to more than
the length of that edge, the browser scales all the radii down by the same
factor until they fit. The corners cannot physically overlap, so the specification tells the
browser to shrink them proportionally rather than let one eat into the other.
The practical upshot: your carefully chosen pixel values are upper bounds, not guarantees, on
small or narrow elements. If a rounded corner looks "capped," the element is shorter or
narrower than the sum of the radii you asked for. It is also why 9999px is safe
for pills — the browser clamps the absurd value down to the largest radius that fits, which
for a rectangle is exactly half the shorter dimension.
The full shorthand, and what border-radius does not do
The longhand order is clockwise from the top-left:
border-radius: top-left top-right bottom-right bottom-left. Two values mean
top-left/bottom-right then top-right/bottom-left; three values fill in a symmetric pattern.
With the slash you can specify up to eight numbers in total — four horizontal radii before it
and four vertical radii after — which is the maximum expressiveness the property allows.
Two things to keep straight. border-radius clips the border, background, and box
shadow to the rounded outline, but it does not clip overflowing child content on its
own — a child image with square corners will still poke out unless you add
overflow: hidden to the rounded parent. And rounding does not change the
element's box for layout: the corners are cut visually, but the element still occupies its
full rectangular space, so siblings and hit-testing behave as if the corners were square.
Frequently Asked Questions
What does the slash in border-radius: 50% / 30% mean?
It separates horizontal from vertical radii. The value(s) before the slash set the
horizontal radius of each corner; the value(s) after set the vertical radius. When they
differ, the corners become elliptical rather than circular — the basis of organic "blob"
shapes.
Why does border-radius: 50% make an oval instead of a circle?
Percentages are relative to the element's own width and height. On a square, 50% gives a
circle; on a rectangle, 50% of the width is a bigger radius than 50% of the height, so you
get an ellipse. Use a square element, or a large fixed length, for the shape you want.
How do I make a pill-shaped button?
Use a large length such as border-radius: 9999px, not 50%. The
browser clamps it to the largest radius that fits, which is half the button's height, so
the ends stay fully rounded even as padding or font size change. 50% would
make an oval on a wide button.
Why is my corner smaller than the radius I set?
When two corners sharing an edge have radii that together exceed that edge's length, the
browser scales every radius down proportionally so they cannot overlap. On small or narrow
elements your pixel values act as upper limits, not exact sizes.
Does border-radius clip an image inside the element?
Not by itself. It rounds the element's own border, background, and box shadow, but a child
with square corners will overflow past the curve. Add overflow: hidden (or
clip) to the rounded parent to trim the child to the same shape.
Does rounding corners change the element's layout box?
No. The rounding is purely visual. The element still occupies its full rectangular area
for layout, spacing, and pointer hit-testing — only the painted corners are cut away.