Border Radius Generator_

Most of what people want from border-radius it cannot do. An inward, concave corner is not a value of this property at all — no number produces one. A thick border leaves the inner corner square, which looks broken and is the definition. And on a table it does nothing whatsoever until you change border-collapse.

What it does do is round the border box, with two radii per corner rather than one. So this generator gives you all eight numbers, shows what a border does to the inside, and hands over the CSS for the three effects that need something else entirely.

toolkit.codes/border-radius-generator
Start from

Top left

Top right

Bottom right

Bottom left

UTF-8
Ready
100% LOCAL
Input
Eight radii — a horizontal and a vertical value for each corner — in pixels or percentages, on a box you can resize and give a border.
Output
The shortest CSS that means exactly those radii, collapsing to one, two or three values where they repeat and using the slash only when a corner is genuinely elliptical.
Processing
Applied to a real element in this tab, including the specification's overlap scaling, so what you see is the browser's own rendering.
Limits
It rounds a box. Inverted corners, squircles and rounded tables are not values of this property — the recipes below are what those actually take.
Why border-radius: 9999px is not a hack
Where two radii on one side would sum to more than that side, the specification scales every radius on the element by the same factor until they fit. An enormous value therefore resolves to exactly half the shorter side, which is precisely a pill. It is the defined behaviour rather than a value that happens to work.

Three things border-radius will not do for you

An inward corner is not this property

border-radius curves outward. There is no value — negative, percentage or otherwise — that curves inward, because the property describes the corner of a box rather than a shape cut out of one. A concave corner is a hole, and holes come from mask, clip-path or an overlaid element positioned to bite into the corner. The radial-gradient mask below is the usual answer and works on any background, which is why it beats the older trick of stacking a same-coloured circle on top.

A border gives the inside its own radius

The radius you set applies to the border box. The padding box gets its own, computed as the outer radius minus the border width and floored at zero — so a 10px border inside a 6px radius produces a perfectly square inner corner while the outside stays rounded. It looks like a rendering fault and it is the definition, and the fix is arithmetic: to keep the two curves looking parallel, the inner radius has to be the outer one minus the border, which means choosing the outer radius with the border already in mind.

On a table it does nothing at all

By default a table collapses its borders, which means adjacent cells share one border and there is no individual box left to round. Setting a radius on the table produces no visible change whatever value you use. It needs border-collapse: separate with border-spacing: 0, and then the radius has to go on the four corner cells rather than on the table — because the table's own corners are covered by them.

Each corner is an ellipse, not an arc

There are eight numbers here, not four. Everything before the slash is a horizontal radius and everything after it is vertical, so border-radius: 50% / 20% gives corners that are wide and shallow rather than circular. This is the entire mechanism behind every "blob" generator: eight percentages, four before the slash and four after, and the shape stops looking like a rectangle at all. Almost nobody writes the slash form, which is why the property seems to have fewer shapes in it than it does.

50% and 9999px are different shapes

On a square they agree and on anything else they do not. A 50% radius is half the width horizontally and half the height vertically, so on a wide box it produces an ellipse — a lens, not a pill. A large pixel value produces true semicircular ends, because the scaling rule caps it at half the shorter side. If you want a stadium shape, the right value is a big number in pixels, and 9999px is the conventional way to write "as round as this box allows".

The background is clipped; the children are not

A background colour or image follows the rounded shape automatically. A child element does not — an image, a video or a nested block will paint its own square corners straight over yours. The fixes are overflow: hidden on the parent, which also clips anything else that escapes, or the same radius on the child, which is more precise and does not create a new scroll container. This is by far the most common reason a rounded card has one stubbornly square corner.

Set the corners, then check the two hard cases

  1. 01Pick a preset to begin. Every one is a shape people genuinely build, and hovering it names the part of the property doing the work.
  2. 02Resize the box. A radius that looks right at one size rarely does at another, and percentages and pixels behave completely differently as it changes.
  3. 03Add a border if the real element has one. The inner corner is computed from the outer radius minus the border width, and that is where rounded cards go wrong.
  4. 04Use the slash — the vertical sliders — when you want a shape rather than a rounded rectangle. Eight numbers is what makes a blob.
  5. 05If you wanted an inward curve, a squircle or a rounded table, take the recipe instead. None of those is a value of this property.

A pill button that came out as a lens

50% looks correct on the square example and produces an ellipse the moment the button has any text in it.

What was written
border-radius: 50%;
What a pill needs
border-radius: 9999px;

Scaled to half the shorter side,
which is a true semicircle.

A bordered card with a square inside

The outside is rounded and the inner edge of the border is not. Nothing is broken.

The values
border: 10px solid;
border-radius: 6px;
What the browser draws
Inner radius = 6 − 10 → 0.
Raise the radius above the
border width to keep it curved.

A table that ignores the radius

The value is on the table, it is spelled correctly, and nothing changes at any size.

Missing
border-collapse: collapse;
What it takes
border-collapse: separate;
border-spacing: 0;
+ radius on the corner cells.

A concave corner

No value of border-radius curves inward, so the property is the wrong tool rather than the wrong number.

Impossible
border-radius: -20px;
What works
A radial-gradient mask.
Works over any background,
unlike the stacked-circle trick.

Reading the shorthand

ValueMeansNote
8pxAll four cornersThe common case
8px 0Top-left and bottom-right, then top-right and bottom-leftDiagonal pairs — a leaf shape
8px 0 4pxTop-left, then both the other diagonal, then bottom-rightRarely written and easy to misread
1px 2px 3px 4pxClockwise from the top leftThe order every CSS box shorthand uses
50% / 20%Horizontal radii, then verticalThe slash. Each corner becomes an ellipse
30% 70% 70% 30% / 30% 30% 70% 70%Eight separate radiiWhat every blob generator produces
9999pxAs round as the box allowsScaled to half the shorter side. A pill
50%Half the width and half the heightA circle only on a square. An ellipse otherwise

Percentages resolve against the element's own dimensions — horizontally against width, vertically against height — so a percentage radius keeps its proportions as the box changes and a pixel radius does not.

Getting corners right

  • Use a large pixel value for pills, not 50%. The specification caps it at half the shorter side, so it is exact rather than approximate.
  • Choose the outer radius with the border width already included. The inner curve is the outer minus the border, and a thick border eats a small radius entirely.
  • Put the radius on the child rather than overflow: hidden on the parent where you can. Hidden overflow also clips shadows, focus rings and anything else that escapes the box.
  • Settle on two or three radius values for a whole project. Components drawn from a small fixed set read as one family; components each given their own number read as a collection.
  • Reach for the slash when a rounded rectangle is not the shape you want. It is the only way to get an ellipse or a blob out of this property.
  • Expect a squircle to stay out of reach. An app-icon corner has continuous curvature, and no radius value reproduces it — that is why a large radius always looks slightly wrong next to one.

Where border-radius goes wrong

It cannot curve inward at any value

Concave corners are cut out of the box rather than described by it, so they need a mask, a clip-path or an overlay. Searching for the right border-radius value for a notch is searching for something that does not exist.

A thick border squares off the inside

The inner radius is the outer one minus the border width, floored at zero. It looks like a rendering bug at small radii and large borders, and it is exactly what the specification says should happen.

Tables need border-collapse: separate

Collapsed borders belong to two cells at once, so no single box exists for the radius to describe and nothing at all is drawn. Separate the borders and the radius then belongs on the four corner cells rather than on the table element.

50% is a circle only on a square

On any other aspect ratio it produces an ellipse, because the horizontal and vertical radii resolve against different dimensions. A pill needs a large pixel value instead.

Child elements paint over the corners

The background follows the shape and a nested image or video does not. Without overflow: hidden on the parent or a matching radius on the child, the corner comes back square.

Values, resolution and scaling

Structure
Eight values — a horizontal and a vertical radius per corner. Everything before the slash is horizontal, everything after is vertical, and each corner is a quarter of an ellipse rather than a circular arc.
Shorthand
One, two, three or four values per side of the slash, expanding clockwise from the top left exactly as every other CSS box shorthand does.
Percentages
Resolved against the border box — horizontal radii against its width, vertical against its height. This is why 50% is a circle only when the box is square.
Overlap scaling
CSS Backgrounds and Borders §5.5: if two radii along a side exceed that side, a factor is computed for each side and the smallest is applied to every radius on the element. One oversized corner therefore shrinks the others.
Inner radius
The padding-box radius is the border-box radius minus the border width, floored at zero. The two curves are concentric rather than parallel.
Clipping
Backgrounds and box-shadow follow the shape. Child boxes do not, and need overflow: hidden on the parent or their own radius.
Support
Unprefixed everywhere since IE9, including the slash syntax and percentages. The -moz- and -webkit- prefixes have been unnecessary for well over a decade.
Network
None from tool code. A test sweep calls every function this page uses with fetch and XMLHttpRequest replaced by stubs that throw, so a stray request fails the build instead of shipping. Disconnect from the network and the page still works.

Questions about border-radius

How do I make an inverted or concave border radius?

You cannot, with this property — border-radius only curves outward and no value reverses that. A concave corner is a piece cut out of the box, which takes a mask, a clip-path or an overlaid element. A radial-gradient mask is the usual answer and works over any background, unlike the older trick of covering the corner with a same-coloured circle.

Why does my border-radius not work on a table?

Because tables collapse their borders by default, so adjacent cells share one border and there is no individual box to round. Set border-collapse: separate with border-spacing: 0, then put the radius on the four corner cells — the table's own corners are covered by them.

Why is the inside of my border square?

The inner radius is the outer radius minus the border width, floored at zero. A 10px border inside a 6px radius therefore has no inner curve left. Raise the radius above the border width, or accept it — the behaviour is defined rather than a bug.

Should I use 50% or 9999px for a pill?

A large pixel value. 50% resolves to half the width horizontally and half the height vertically, which gives an ellipse on anything that is not square. A big pixel number is scaled by the browser to exactly half the shorter side, which is a true stadium shape.

What does the slash in border-radius mean?

It separates horizontal radii from vertical ones. border-radius: 50% / 20% makes each corner a quarter of an ellipse that is wide and shallow rather than circular. Eight values — four either side of the slash — is what every blob generator emits.

Why is my border-radius smaller than I set it?

Because the radii overlapped. Where two radii along one side sum to more than that side, the browser scales every radius on the element by the same factor until they fit, so one oversized corner shrinks the others. It is also why an enormous value like 9999px is safe.

Why does an image inside my rounded box have square corners?

Backgrounds follow the shape but child elements do not. Add overflow: hidden to the parent, or the same radius to the image. The second is usually better, since hidden overflow also clips shadows and focus rings.

How do I make a squircle like an app icon?

Not with border-radius. An app-icon corner has continuous curvature rather than a circular arc, which is why a large radius always looks slightly wrong beside one. A clip-path with a path, or an SVG, is the closest CSS gets until superellipse shapes are widely supported.

Do I still need -webkit- or -moz- prefixes?

No. border-radius has been unprefixed in every browser since IE9, including the slash syntax and percentage values. Prefixed versions in a stylesheet today are dead weight.

Does the CSS I write here go anywhere?

No. The work is JavaScript running in this tab. Every function it calls is covered by a test that stubs fetch and XMLHttpRequest to throw, so a request that slipped in would break the build rather than reach a server — and you can confirm it for yourself by disconnecting and carrying on.

Recipes for the shapes this property has no value for

Inverted corners

border-radius only curves outward. An inward corner is a hole cut in the box, which means a mask or a gradient — not this property, at any value.

/* Concave corners with a radial-gradient mask */
.inverted {
  --r: 24px;
  mask:
    radial-gradient(var(--r) at 0 0, #0000 98%, #000) 0 0,
    radial-gradient(var(--r) at 100% 0, #0000 98%, #000) 100% 0,
    radial-gradient(var(--r) at 100% 100%, #0000 98%, #000) 100% 100%,
    radial-gradient(var(--r) at 0 100%, #0000 98%, #000) 0 100%;
  mask-size: 51% 51%;
  mask-repeat: no-repeat;
}

A single notch

One inward curve, as on a ticket stub or a tab. Same principle, one gradient.

/* One concave bite out of the left edge */
.notch {
  --r: 20px;
  mask: radial-gradient(var(--r) at 0 50%, #0000 98%, #000);
}

Rounding a table

border-radius does nothing on a table with collapsed borders, because the borders are shared between cells and there is no box to round. This is why it "does not work".

/* Radius needs separate borders, then the corner cells carry it */
table { border-collapse: separate; border-spacing: 0; }
tr:first-child th:first-child { border-top-left-radius: 8px; }
tr:first-child th:last-child  { border-top-right-radius: 8px; }
tr:last-child  td:first-child { border-bottom-left-radius: 8px; }
tr:last-child  td:last-child  { border-bottom-right-radius: 8px; }

A squircle

The rounded square on an app icon is not a border-radius shape — its curvature is continuous rather than a circular arc, which is why a large radius never quite matches it.

/* The closest CSS gets, until superellipse() ships broadly */
.squircle {
  clip-path: path('M 0,50 C 0,0 0,0 50,0 S 100,0 100,50 100,100 50,100 0,100 0,50');
}