Border Radius Generator

Border radius—
Full CSS—

How Border Radius Generator is calculated: border-radius: top-left top-right bottom-right bottom-left — clockwise from the top left; 16px on all four corners is the standard card rounding; radius past half the height = pill.

What is a border radius generator?

A border radius generator builds a CSS border-radius from four numbers, one for each corner of a box, and shows you the result. You set the top-left, top-right, bottom-right, and bottom-left corners, and it gives you the CSS string, 16px 16px 16px 16px, plus a live preview box with those corners. Copy the string into a stylesheet and any element gets the same corners.

The default on this page is 16 pixels on every corner: 16px 16px 16px 16px, and the full CSS is border-radius: 16px 16px 16px 16px. Sixteen pixels is the gentle rounding most cards and buttons use: enough to see, not enough to look round. The preview box shows it as a soft-cornered rectangle in green.

Rounded corners are everywhere in modern design. Cards, buttons, inputs, images, modals: almost every element on a modern page has some rounding. The radius is what separates a sharp, formal rectangle from a friendly, modern one, and a few pixels make a visible difference.

Everything runs in your browser. The numbers you type never leave your device, and there is no account to create. The preview updates with every keystroke, so you can tune the corners until the box looks right.

How CSS border radius works

Border radius rounds the corners of an element by cutting each corner with a quarter circle. The radius is the radius of that circle: a radius of 16 pixels means each corner is rounded with a circle 16 pixels across. A radius of 0 means a sharp corner, no circle at all. A larger radius means a rounder corner.

The four values go clockwise from the top left: top-left, top-right, bottom-right, bottom-left. That order matters, because the corners are independent: you can round the top two and leave the bottom two sharp, which is the standard shape for a card that sits on top of another element, or round one corner only for an asymmetric look.

When all four values are equal, the box is evenly rounded, which is the most common case. When they differ, the box takes on a shape: 24px 12px 24px 12px gives a box with rounder corners on the top-left and bottom-right, and tighter corners on the other two, a diagonal pattern that reads as playful.

There is a limit to how round a corner can look. A radius larger than half the height of the element is the same as half the height: on a 40-pixel-tall button, a radius of 20 gives a pill shape, and a radius of 200 looks exactly the same, because the circle is already as big as the element allows. The generator accepts up to 200 pixels, and anything past half the height is a pill.

The four corners, and what each one does

The top-left corner is the first value, and it is the one the eye lands on first, because the eye reads from the top left. A rounded top-left softens the entry point of the element. Most designs round all four corners equally, so the top-left is rarely set alone, but when a card sits at the top of a page, its top corners are the ones that matter most.

The top-right corner is the second value. It mirrors the top-left, and in a symmetric design it matches it exactly. When the top two differ, the box leans: a larger top-right makes the box feel like it tilts right, which is a subtle effect that works on decorative elements and looks like a mistake on functional ones.

The bottom-right corner is the third value. It is the corner the eye leaves last, and it is the one that matters most for a card that sits above a footer or another element. A card with rounded top corners and sharp bottom corners reads as attached to the thing below it, which is the standard shape for a header card.

The bottom-left corner is the fourth value. It mirrors the bottom-right, and in most designs it matches it. The four corners together decide the whole shape: equal values give a soft rectangle, two large and two small give a diagonal, one large and three small give an accent corner, and all zero gives a sharp rectangle.

A worked example: three boxes, three shapes

First, the default: 16, 16, 16, 16 gives 16px 16px 16px 16px, and the full CSS is border-radius: 16px 16px 16px 16px. Every corner is rounded by the same 16 pixels, so the box is an evenly softened rectangle. It is the standard card shape, and it is the default on this page.

Second, the diagonal: 24, 12, 24, 12 gives 24px 12px 24px 12px. The top-left and bottom-right corners are rounder at 24 pixels, and the top-right and bottom-left are tighter at 12. The box has a diagonal rhythm, rounder on one diagonal than the other, which reads as playful without being uneven.

Third, sharp: 0, 0, 0, 0 gives 0px 0px 0px 0px. No corner is rounded at all, so the box is a sharp rectangle. It is the baseline: any rounding is measured against sharp, and this is what a design looks like with no rounding anywhere.

One more, to show the pill: 20 pixels on a 40-pixel-tall button gives a pill shape, because 20 is half the height. Set all four corners to 200 on a short element and the result is the same pill, because the radius cannot exceed half the height. The generator accepts up to 200, and the preview shows the pill once the radius passes half the box height.

Who uses a border radius generator, and why

Web developers use it every time a design calls for rounded corners. The design file shows a card with 16-pixel corners, and the developer needs the exact CSS. The generator produces it, with the preview confirming the look, and the string goes straight into the stylesheet.

Designers use it to test a corner before committing to it. A radius that looks right in a design tool can look too round or too sharp on a real page, because the tool and the browser render the curve differently. The preview here is the browser rendering, so what you see is what the page will show.

Content creators use it for images and cards. A photo with rounded corners looks softer and more modern than a sharp rectangle, and a card with rounded corners looks friendlier than a sharp one. The generator is the fastest way to get from a sharp design to a rounded one.

App developers use it for the same reason in web views and hybrid apps. An image round corners tool rounds the corners of a picture itself, and an image border tool frames it; the border-radius generator does the same job for any element on the page, not just pictures. A background color changer shows what rounded corners look like against a different page colour.

Border radius vs a rounded image

A border radius and a rounded image do similar-looking jobs, and it is worth knowing which one you need. Border radius rounds the corners of an element on the page: a card, a button, a box. A rounded image rounds the corners of the picture file itself, so the rounding travels with the file wherever it goes.

The difference is where the rounding lives. Border radius lives in the stylesheet, so it can change with the design: a card that is rounded on desktop can be sharp on mobile, just by changing the CSS. A rounded image lives in the file, so it is rounded everywhere, on every site and in every context, and it cannot be unrounded without editing the file.

The other difference is scope. Border radius works on any element, including text boxes, buttons, and empty divs. A rounded image only works on that one picture. If the design needs a rounded card with text inside, border radius is the tool. If the design needs a rounded photo to share on social media, the image tool is the tool.

In practice, the two are used together: a card with a border radius, holding a picture with rounded corners, so the picture matches the card. A SCSS calculator helps when the same radius has to be reused across a stylesheet with variables, so it is defined once and used everywhere.

Common border radius mistakes

The first mistake is rounding everything the same. A page where every element has a 16-pixel radius looks soft but samey, and nothing stands out. Cards get 16, buttons get 8, inputs get 6, and modals get 24: different elements get different radii, and the hierarchy shows in the corners.

The second mistake is a radius that is too large for the element. A 200-pixel radius on a 40-pixel-tall button is a pill, which is fine if a pill is what you want, but it is a surprise if you wanted a gentle rounding. Check the radius against the height: anything past half the height is a pill, and the preview here shows it.

The third mistake is asymmetric corners on functional elements. A button with one rounded corner and three sharp ones looks broken, not designed. Asymmetric corners belong on decorative elements: a hero image, a banner, a card that is meant to catch the eye. Buttons, inputs, and cards should be symmetric.

The fourth mistake is the order of the four values. The order is top-left, top-right, bottom-right, bottom-left, clockwise from the top left. Swapping the second and fourth values mirrors the shape, and the result looks wrong in a way that is hard to spot. If a shape looks mirrored, check the order first.

How to use this border radius generator

Set the four corners from 0 to 200 pixels: top-left, top-right, bottom-right, bottom-left. The CSS string and the live preview update instantly as you type. There is no button to press.

Copy the CSS string for your stylesheet. It reads border-radius: 16px 16px 16px 16px with your own values. Paste it as the border-radius of any element, and the corners round. For a pill shape on a short element, set all four corners to half the element height or more.

Tune by eye. Start from the default of 16 on every corner, raise it for a softer look, lower it for a sharper one. The preview box shows the shape on a white page; check it at the real size too, because a radius looks rounder on a small element than on a large one.

Everything runs in your browser. No sign-up, no account, no data sent anywhere. The numbers you typed never leave your device, and the page works offline once it has loaded.

Frequently Asked Questions

border-radius: 16px 16px 16px 16px. The four values go clockwise from the top left: top-left, top-right, bottom-right, bottom-left. Sixteen pixels on every corner is the gentle rounding most cards and buttons use.

Clockwise from the top left: top-left, top-right, bottom-right, bottom-left. So 24px 12px 24px 12px rounds the top-left and bottom-right to 24 pixels and the other two to 12. Swapping the second and fourth values mirrors the shape.

Set the radius to half the button height or more. On a 40-pixel-tall button, 20 pixels on all four corners gives a pill shape, and anything larger looks the same, because the radius cannot exceed half the height. This generator accepts up to 200 pixels per corner.

Because the radius is capped by the element size. A corner circle cannot be bigger than half the height of the element, so on a 40-pixel-tall button any radius of 20 or more gives the same pill shape. The extra pixels have nowhere to go, so the browser clips the curve at half the height.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.