CSS Border Radius Generator

Grab a corner handle and pull it inward. Resize the box, split any corner into a horizontal and a vertical radius, then copy the shorthand with the slash syntax already worked out.

260 x 180 px
Every radius fits inside its side. The browser draws your values as written.

Corner values

Top left
Top right
Bottom left
Bottom right

Box the radius sits on

Render as
Shapes worth starting from
Shorthand
Longhand

An avatar set to border-radius: 50% on a 200 by 120 image comes out as an egg, not a circle. A pill button built the same way stretches into an ellipse the moment its label wraps to a second line. Both bugs come from the same detail, and dragging the corners on the box above makes it visible in about ten seconds.

Pull a corner instead of typing a number

The four handles sit on the inside of each corner. Drag one toward the middle of the box and the arc grows behind it. Horizontal movement feeds the corner's horizontal radius, vertical movement feeds the vertical one, so a diagonal pull rounds evenly and a sideways pull flattens the curve. Arrow keys nudge a focused handle by one step, and Shift with an arrow key moves it by ten.

Leave Move all four corners together checked while you find a shape you like, then uncheck it to break one corner away. Chat bubbles, tab strips, and card stacks nearly always come down to three matching corners and one odd one.

One radius per corner, or two

A corner is not a quarter circle by default. It is a quarter ellipse, and CSS lets you set the two axes separately. Flip Two radii per corner and each corner gains a V field next to its H field. The output switches to the slash form:

border-radius: 60px 20px 60px 20px / 30px 40px 30px 40px;

Everything before the slash is horizontal, everything after is vertical, and both groups run top left, top right, bottom right, bottom left. Most people never write this form by hand, which is why blob shapes and soft asymmetric cards look hard to build. They are four numbers on each side of one slash.

Percentages resolve against two different axes

A percentage radius is not measured against one dimension. The horizontal half of a corner resolves against the element's width, the vertical half against its height. Set the unit above to %, type 50 into every field, then drag the width slider while the height stays put. The shape stays a perfect ellipse filling the box, and it stops being a circle the instant the two dimensions differ.

This is the egg-shaped avatar. border-radius: 50% only draws a circle on a square element. Force the square with aspect-ratio: 1 or equal width and height values, then apply the radius.

When the browser quietly shrinks your radii

Set the box to 200 pixels wide and give the top left and top right corners 150 pixels each. The two arcs need 300 pixels of a 200 pixel edge. Nothing overlaps on screen, because the browser rescales instead.

The rule is in the spec: for every side, divide the side length by the sum of the two radii touching it. Take the smallest of those four ratios, and if it lands below 1, multiply every radius on the element by it. The reduction is proportional and applies to all eight values at once, not only the pair causing the conflict. The strip under the preview reports the exact factor whenever this kicks in, along with which edge triggered it.

This is why border-radius: 9999px renders a clean stadium shape rather than an error. The value is absurd, the scaling rule reduces it to exactly half the shorter side, and you get the maximum rounding the box allows.

Pill buttons: 50% or 9999px

Both look identical on a single-line button, and they part ways the moment the element changes shape:

Use the large pixel value for pills and tags. Save 50% for elements you have already forced into a square, such as avatars and icon buttons.

What a rounded corner does not do on its own

The radius clips the element's own background and border. Child content ignores it completely. An image inside a rounded card keeps its square corners poking past the curve until the parent gets overflow: hidden, and that property brings side effects worth knowing about, since it also clips dropdowns and tooltips escaping the card.

Two more details show up in real components:

Where this tool stops

The output covers border-radius and nothing else. Four things sit outside it:

Everything runs in your browser. The preview, the scaling calculation, and both code blocks are built with JavaScript on your machine, and no values reach a server.

Border radius questions worth answering

The things people hit after the generated rule lands in a real stylesheet.

Why is my 50% avatar an oval instead of a circle?

A percentage radius resolves against two axes at once. The horizontal half uses the width, the vertical half uses the height, so 50% draws an ellipse on any element whose width and height differ. Force a square with aspect-ratio: 1 or matching dimensions, then the same value gives a circle.

What does the slash in a border-radius value mean?

It separates horizontal radii from vertical radii. Values before the slash set the horizontal axis of each corner, values after set the vertical axis, and both lists run top left, top right, bottom right, bottom left. Switch on Two radii per corner above to generate the form.

Why does border-radius: 9999px not break the layout?

CSS scales oversized radii down. The browser checks every side, finds the smallest ratio of side length to the sum of its two radii, and multiplies all eight values by that number when it falls below 1. A 9999px value reduces to exactly half the shorter side.

Should a pill button use 50% or a huge pixel value?

Use the pixel value. 50% follows the element dimensions and bows the top and bottom edges once the label wraps to two lines, while a clamped pixel value keeps the flat middle and semicircular ends at any height.

My image still has square corners inside a rounded card. Why?

A radius clips the element background, not its children. Add overflow: hidden to the rounded parent, or apply the same radius directly to the image. Watch out for anything meant to escape the card, since overflow: hidden clips dropdowns and tooltips too.

How do I round a nested element so it matches the outer corner?

Subtract the gap between them. An outer 16px radius with 4px of padding wants 12px on the inner element. Borders are the exception, since browsers already reduce the inner curve of a bordered box by the border width.

Can this generate an Apple-style squircle?

No. Continuous corners use a superellipse curve rather than the quarter ellipse border-radius draws. The Soft square preset approximates the look with percentage radii, and an exact squircle needs an SVG, a clip-path, or the newer CSS corner-shape property once support is wide enough.