Geometry & layout
Nested Corner Radius Calculator
Picture a photo inside a rounded card. Enter the card’s corner radius and the space around the photo. Apply the calculated inner radius to the photo’s corners.
Leave the same distance on all four sides of the photo.
Geometry preview
Scaled to fit · values in CSS px
- Effective outer radius
- 32 px
- Inner radius
- 16 px
- Total inset
- 16 px
Box model & dimensions
Border-box dimensions. Total inset = border + padding. Up to 100,000 px.
Inner radius = max(0, 32 − 16)
Geometry preview
Scaled to fit · values in CSS px
- Effective outer radius
- 32 px
- Inner radius
- 16 px
- Total inset
- 16 px
Use the result
.outer {
box-sizing: border-box;
width: 320px;
height: 240px;
border: 0px solid currentColor;
padding: 16px;
border-radius: 32px;
}
.inner {
box-sizing: border-box;
width: 100%;
height: 100%;
border-radius: 16px;
}Calculations stay in your browser. Display: up to 10 significant digits. Export keeps calculation precision.
Behind the geometry
One centre. Consistent corners.
Subtract the total inset from the outer radius to find the inner radius. Inset is the distance from the outer border-box edge to the inner element’s border-box edge: border width + CSS padding.
Rᵢ = max(0, Rₒ − (b + p))
For example: a 32 px outer radius, 2 px border and 14 px padding give a 16 px inner radius. All measurements are CSS pixels and use border-box dimensions.
How are large radii normalized?
CSS reduces radii when adjacent corners overlap. With four equal circular corners, the effective outer radius is min(entered radius, width / 2, height / 2). This is applied before calculating the inner radius. The CSS output uses effective values.
Why is the inverse ambiguous at zero inner radius?
Clamping to zero maps several outer radii or padding values to the same result. The tool shows a valid interval instead of inventing one answer. Positive inner radii are concentric; zero is a clamped case.
Scope and limits
Supports four equal circular corners and a uniform inset. Elliptical or independent corners, percentage radii, Figma corner smoothing and squircles are outside this model. Recalculate if dimensions or inset change. JSON is the tool’s plain data output; it is not a Figma plugin or DTCG token package.
Technical reference: W3C CSS Backgrounds & Borders.