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.
The formula used by the tool is:
inner-radius = max(0, outer-radius − padding)
Important notes:
0.px or both in rem). If you mix units, results will not be valid.calc() (as a semantic formula) and a numeric fallback value for browser reliability.
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;
}
.outer is very useful: if you don't want to calculate the inner radius at all, you can simply set radius on the outer element and let overflow: hidden clip the content — same visual effect with zero math.rem, ensure padding and radius scale logically — the tool lets you pick units but does not convert mixed units.0 for a clean sharp corner.
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.