🎨 CSS

CSS Border Radius Generator

Shape each corner independently, sculpt organic curves with 8-point slash syntax, and copy clean CSS or Tailwind classes instantly.

Preview
Quick Presets:
Generated Declaration

About the Border Radius Generator and CSS Curved Geometry

Quick Answer: The CSS Border Radius Generator is a visual styling tool for crafting rounded corners, pill shapes, and organic fluid blobs. It supports standard 4-corner circular arcs, advanced 8-point slash syntax (horizontal / vertical curvature), and responsive percentage units, with instant code export for CSS, Tailwind CSS, and CSS Custom Properties.

The CSS border-radius property accepts values for each corner in clockwise order: top-left, top-right, bottom-right, and bottom-left. When all four corners share identical dimensions, modern browsers accept a single collapsed shorthand value. Turning on slash syntax introduces independent horizontal and vertical radii per corner, allowing web designers to create non-standard organic shapes and blob silhouettes directly in CSS without SVG assets.

The Mathematical Anatomy of CSS Box Model Corners

In standard vector geometry, rounding a 90-degree rectangle corner involves inscribing an arc of a circle or an ellipse tangent to both intersecting straight edges. The CSS Backgrounds and Borders Module Level 3 defines corner radii along two axes:

When you declare a standard single-value property like border-radius: 16px;, the browser assigns Rx = 16px and Ry = 16px equally across all four corners, drawing four identical circular quarter-arcs. When you specify independent horizontal and vertical values using the slash separator (e.g., border-radius: 40px / 20px;), the browser inscribes quarter-ellipses with unequal axes, producing sleek stretched curvatures reminiscent of automotive and industrial industrial design.

CSS Border-Radius Property and Syntax Comparison

Syntax Style Value Structure Visual Geometry Primary Use Case Browser Compatibility
Uniform Shorthand border-radius: 12px; Equal circular arcs on all corners Cards, badges, input fields All modern browsers (100%)
4-Corner Independent border-radius: 16px 16px 0 0; Targeted rounding per corner Tabs, modals, chat bubbles All modern browsers (100%)
Pill / Capsule border-radius: 9999px; Half-height semicircular caps Call-to-action buttons, status tags All modern browsers (100%)
8-Point Slash Syntax 60% 40% 30% 70% / 60% 30% 70% 40% Elliptical, asymmetrical fluid curves Organic blobs, creative hero shapes All modern browsers (100%)
Tailwind Utility rounded-[16px] or rounded-full JIT-compiled utility class Modern utility-first web workflows Tailwind CSS v3+ / v4+

Why the Clockwise Sequence Starts at Top-Left

A frequent question among web developers is why border-radius starts at the top-left, whereas four-value shorthands like margin and padding start at the top. The explanation lies in what the properties represent:

Mastering 8-Point Slash Syntax for Organic Blobs

Standard CSS corners render circular arcs because horizontal and vertical radii are equal. When you insert a forward slash /, the values preceding the slash dictate the horizontal radii across all four corners, while the values succeeding the slash dictate the vertical radii:

/* Syntax: top-left-x top-right-x bottom-right-x bottom-left-x / top-left-y top-right-y bottom-right-y bottom-left-y */
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;

By defining complementary percentages that sum to 100% along opposing quadrants (e.g., top-left-x = 60% and top-right-x = 40%), you create smooth curvature transitions where one corner blends fluidly into the next. This creates asymmetrical, organic liquid droplets and fluid blobs that animate beautifully without requiring external SVG path vectors or canvas scripts.

Browser Clamping and the Proportional Reduction Formula

What happens if you assign border-radius: 100px; to an element that is only 50px wide and 50px tall? Under standard geometric rules, four 100px quarter-circles would intersect and invert the box model.

To eliminate rendering artifacts, the W3C specification enforces an automatic scaling algorithm known as the Corner Overlap Rule. If the sum of any two adjacent corner radii exceeds the length of the connecting edge, the browser calculates a reduction ratio f = min(width / (r_top_left + r_top_right), height / (r_top_right + r_bottom_right), ...). If f < 1, every radius on the element is multiplied by f. Because the scaling factor is applied proportionally across all corners, shapes maintain their intended aspect ratios while perfectly fitting inside the container boundaries.

Concentric Radii in Nested UI Containers

A classic visual bug in modern dashboard design is the nested radius misalignment problem. When a developer places an inner container (such as a thumbnail image or input field) inside a rounded card, applying the same border-radius to both elements produces an awkward, pinched gap in the corners.

In classical geometry, concentric curves require the inner radius to share the same center of curvature as the outer radius. The mathematical formula for concentric inner corner curvature is:

R_inner = max(0px, R_outer - Padding)

For example, if a parent card features border-radius: 20px and padding: 8px, the child element nested inside must have border-radius: 12px (20px minus 8px). If the padding equals or exceeds the outer radius, the inner child should remain a crisp 0px square.

Pills, Capsules, and Circles: Percentages vs Giant Pixels

Web developers frequently need pill-shaped buttons or circular avatars. Choosing between percentage and pixel units requires understanding how the browser computes aspect ratios:

Child Clipping and Subpixel Anti-Aliasing Bleed

When applying a border-radius to a container holding full-bleed child elements (such as hero photographs or background video players), child pixels will visually bleed beyond the rounded corners. To clip child elements to the curved border, developers typically apply overflow: hidden; to the parent container.

On high-density displays (such as Apple Retina screens), slight subpixel rounding differences between the parent border-radius mask and the child content can occasionally reveal a faint 1-pixel jagged artifact. To resolve this anti-aliasing seam, developers frequently apply a tiny matching border-radius directly to the child element or use CSS clip-path to enforce clean GPU rasterization.

Frequently Asked Questions

Why is the corner order top-left, top-right, bottom-right, bottom-left instead of starting at the top?

CSS box-model shorthands like margin and padding describe edges and go clockwise from the top edge. border-radius describes corners instead, so its clockwise order starts at the top-left corner. This tool's four inputs follow that exact spec order so the generated CSS matches what you hand-write.

How does the 8-value slash syntax create organic blob shapes?

The slash syntax separates horizontal radii from vertical radii (horizontal / vertical). By supplying different horizontal and vertical curvature dimensions to each of the four corners, elements morph from standard rounded rectangles into fluid, asymmetrical organic blobs.

When should I use percentages instead of pixels for border-radius?

Use percentages when building responsive components whose dimensions scale dynamically, such as 50% for circles and avatars. Use pixel units for fixed cards, buttons, dialog boxes, and design tokens where corner curvature must remain consistent across screen sizes.

What happens if I set a corner radius larger than half the box's size?

Per the CSS specification, the browser automatically applies proportional reduction so the sum of adjacent radii never exceeds the edge length. Setting a large radius like 9999px creates a clean pill shape with capped semicircular ends.

Does turning off Link all corners keep my current values?

Yes, unchecking the link option preserves your existing corner values and allows you to modify each corner independently. Re-checking the link box re-synchronizes all corners to the current top-left value.

How do I apply custom border-radius values in Tailwind CSS?

Select the Tailwind output format to generate arbitrary value utility classes like rounded-[20px] or rounded-[60%_40%_30%_70%/60%_30%_70%_40%] using underscore separators for spaces.

How does border-radius interact with overflow: hidden on child elements?

Applying border-radius to a parent container curves its visual border, but child content like images or background colors will bleed past the curved corners unless overflow: hidden or clip-path is explicitly applied to the parent.

What is the difference between circular and elliptical border radii?

A circular radius uses a single value to draw a quarter-circle arc of equal radius along both the X and Y axes. An elliptical radius uses two values (horizontal and vertical) to construct an elongated quarter-ellipse curve.

Can border-radius be animated smoothly with CSS transitions?

Yes. All modern browser rendering engines interpolate border-radius values smoothly within CSS transitions and keyframe animations, enabling dynamic shape-morphing effects on hover or state change.

Why do nested rounded containers need different radii for visual symmetry?

To maintain concentric visual alignment, an inner child container radius must equal the outer parent radius minus the padding between them (R_inner = R_outer - padding). Using identical radii makes inner corners look awkward and pinched.