CSS Inner Corner Radius Generator




Computed inner radius:
Preview
inner-radius
Generated code

CSS Inner Corner Radius Generator

How the Inner Corner Radius Generator Works?

This tool calculates the radius for the inner element based on two values you enter: the outer border-radius and the padding applied to the outer element. The logic is simple - if you want the inner corner to look smooth and follow the shape of the outer box, you must subtract the padding value from the outer radius.

Formula and Key Rules

The formula used by the tool is:

inner-radius = max(0, outer-radius − padding)

Important notes:

Example of Generated HTML/CSS

Here’s an example generated by the tool. The outer radius is 30px, padding is 20px, which makes the inner radius 10px.

<!-- HTML -->
<div class="outer">
  <div class="inner"></div>
</div>

<!-- CSS -->
:root {
  --outer-radius: 30px;   /* outer border-radius */
  --outer-padding: 20px;  /* outer padding */
  --outer-bg: #e6e6e6;
  --inner-bg: #ffffff;
}

/* outer element */
.outer {
  width: 380px;
  height: 220px;
  padding: var(--outer-padding);
  border-radius: var(--outer-radius);
  background: var(--outer-bg);
  box-sizing: border-box;
  overflow: hidden; /* optional: clips content for smooth corners */
}

/* inner element — formula: outer - padding */
.inner {
  width: 100%;
  height: 100%;
  background: var(--inner-bg);
  /* semantic calc example */
  border-radius: calc(var(--outer-radius) - var(--outer-padding));
  /* fallback for full browser support */
  border-radius: 10px;
}

Notes and Practical Tips

Conclusion

The Inner Corner Radius Generator helps you create smooth, perfectly aligned inner corner radii by applying the formula inner = outer - padding and outputs safe, production-ready CSS. If you'd like, I can also create a short intro version, SEO meta description, and CTA text for your tool page.

Last update: 31. 10. 2025.