border radius calculator

Interactive Border Radius Calculator

Adjust each corner, choose your unit, and copy the CSS instantly.

Horizontal Radius (Top-Left, Top-Right, Bottom-Right, Bottom-Left)
Vertical Radius (for elliptical corners)
Preview
Generated CSS:
border-radius: 20px;

What is a border radius calculator?

A border radius calculator helps you create rounded corners for web elements and generates ready-to-use CSS. Instead of guessing values and refreshing your browser over and over, you can visually tune the shape and copy the exact border-radius line.

It is useful for UI components like cards, buttons, profile images, callout boxes, and hero panels. With advanced values, you can even build organic blob-like shapes using elliptical corner radii.

How border-radius works in CSS

Basic syntax

The simplest version looks like this:

border-radius: 12px;

That applies one value to all four corners equally.

Four-corner syntax

You can also target each corner in clockwise order:

border-radius: top-left top-right bottom-right bottom-left;

Example:

border-radius: 8px 24px 8px 24px;

Elliptical radius syntax

For more advanced shapes, use a slash to separate horizontal and vertical radii:

border-radius: 30px 10px 30px 10px / 10px 30px 10px 30px;

This is where many developers get stuck, and exactly why this calculator is handy.

Why designers and developers use rounded corners

  • Visual softness: Rounded corners reduce harsh geometry and feel more approachable.
  • Focus: They can draw attention toward content instead of borders.
  • Brand personality: Larger radii feel friendly and modern; tighter radii feel precise and professional.
  • Consistency: A radius scale (for example 4, 8, 12, 16) creates a more polished design system.

Practical border radius patterns

1) Cards and panels

Use 8px to 16px for card layouts. Pair with subtle shadows for depth.

2) Buttons

Square buttons: 4px to 8px. Rounded buttons: 9999px for a pill shape (height controls the final look).

3) Avatars

For circles, use equal width and height plus border-radius: 50%;.

4) Hero sections and blobs

Use mixed or elliptical values to create unique decorative elements that still perform well in modern browsers.

Common mistakes (and quick fixes)

  • Problem: Corners don’t look rounded. Fix: Make sure the element has a visible background or border.
  • Problem: Child image spills outside rounded container. Fix: Add overflow: hidden; to the parent.
  • Problem: Inconsistent UI feel. Fix: Define a radius scale and reuse it site-wide.
  • Problem: Radius appears too strong on small components. Fix: Reduce values proportionally to element size.
Tip: The same radius can look very different depending on width/height ratio. Always test in a real layout, not just isolated components.

Border radius best practices for production

Create a token scale

Use CSS variables so your corner style stays consistent:

:root {
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

Keep interactions consistent

If your buttons and inputs belong to the same UI family, keep similar radius values so the interface feels intentional.

Use percentage values carefully

Percent-based radii depend on element dimensions. They are excellent for circles and capsules but can produce unexpected shapes on dynamic blocks.

Quick FAQ

Is border-radius supported everywhere?

Yes, it is broadly supported in all modern browsers and has been stable for years.

Can I animate border radius?

Absolutely. You can animate it with CSS transitions or keyframes for hover effects and micro-interactions.

Should I use big radii everywhere?

Not always. Match corner softness to your brand tone and component size. Subtle consistency usually beats dramatic variation.

Final thoughts

A good border radius is a small detail that makes a big difference. Use the calculator above to experiment quickly, generate clean CSS, and keep your interface visually cohesive. Whether you are styling a single button or a full design system, rounded corners are one of the fastest ways to improve perceived polish.

🔗 Related Calculators