CSS Border Radius Generator
100% LocalGenerate border-radius CSS with per-corner control and live shape preview.
Drag corners or type pixel values. The preview updates live and the CSS copies to clipboard.
Learn More
What is CSS Border Radius Generator?
Frequently Asked Questions
Technical Deep Dive
CSS Border Radius Generator
Adjust all four corners independently or together with a linked mode. Includes 10 presets (Pill, Leaf, Bubble, Chat, Tab, Squircle…), a visual corner display, shorthand/longhand output toggle, and Tailwind CSS class suggestion.
Pixel-Precise Output
Generates CSS, tokens, or assets that match what your design system expects.
Live Visual Preview
See changes the moment you make them, no copy-paste cycle between tool and IDE.
Copy-Paste Ready
Output is formatted for direct use in stylesheets, Tailwind configs, or Figma tokens.
01 Shorthand Value Mapping
| Values | Mapping Pattern | Example |
|---|---|---|
| 1 Value | All Corners | 8px |
| 2 Values | [TL,BR] [TR,BL] | 8px 16px |
| 3 Values | [TL] [TR,BL] [BR] | 8px 16px 4px |
| 4 Values | TL, TR, BR, BL | 8px 4px 2px 0 |
02 Common Shape Archetypes
-
The 9999px Pattern Using an oversized pixel value ensures a perfect "pill" shape regardless of the element's height, as browsers collapse overlapping radii.
-
Squircle Approximation Replicate the iOS app icon feel using elliptical radii (e.g.,
30% / 50%) for a smoother, continuous curvature transition. -
Asymmetry Zero-width corners paired with full-width opposite corners create organic, hand-drawn effects perfect for modern landing pages.
03 Border Radius in the Wild
Radius is the most under-appreciated token in a design system. The same component with 4px corners reads as enterprise SaaS; at 16px it reads as consumer; at 9999px it becomes a pill. Here is where radius decisions actually live.
-
Card Corners (4-16px) Cards in Linear use 8px, Notion uses 6px, Stripe uses 12px. The whole product feels different at each value. Pick once at the system level and apply it everywhere, including nested elements (a 4px inner radius inside a 12px card looks structurally honest).
-
Pill Buttons via 9999px Per CSS Backgrounds 3 §5.5, when corner radii would overlap, browsers scale them all down proportionally to fit.
border-radius: 9999pxalways collapses to "fully round on the short axis", pill on a tall button, circle on a square. Used everywhere because it is shape-independent. -
iOS-Style Squircle Approximation Apple's app icons use a superellipse (x^n + y^n = r^n) for "continuous curvature", the corner blends into the side smoothly. CSS only offers quadratic Béziers. The closest approximation is elliptical radii like
30% / 50%; for pixel-perfect squircles, fall through toclip-path: path()or SVG. -
Circular Avatars from a Rectangle A profile image with
border-radius: 50%only renders as a circle if the element is square. On a rectangle, 50% gives an ellipse. Useaspect-ratio: 1alongsideborder-radius: 50%to enforce squareness without setting fixed dimensions. -
Focus Rings That Follow the Curve A rounded button with a rectangular outline looks broken. Either use
box-shadow: 0 0 0 3px ...for the focus ring (it inherits border-radius) or setoutline-offsetand let modern browsers' outline follow the radius (Chrome 94+, Safari 16.4+).
04 Worked Examples
border-radius: 50% 25% / 25% 50%;
/* The "/" splits horizontal radii from vertical radii.
TL/TR/BR/BL horizontal: 50% 25% 50% 25%
TL/TR/BR/BL vertical: 25% 50% 25% 50% /
border-radius: 0 100% 0 100%;
/Top-left and bottom-right pin; top-right and bottom-left round out. /
The slash syntax is CSS Backgrounds 3 §5.5. Each of the eight values (4 corners × 2 axes) can be a different length or percentage, that is what unlocks hand-drawn-feel shapes.
border-radius: 22%;
/Distinguishable "kink" where the curve meets the straight side. /
/Until CSS adopts corner-shape: superellipse(...) (Working Group draft),
the workaround is clip-path with a hand-tuned path: /
clip-path: path("M 100,0 ... continuous-curvature path data ...");
The CSS Working Group's "CSS Borders and Box Decorations 4" draft proposes corner-shape: superellipse(n). Until that ships, ellipse approximations get you 90% of the way for design work.
.avatar { width: 200px; height: 100px; border-radius: 50%; }
/Result: ellipse, flattened circle. /
.avatar { width: 200px; aspect-ratio: 1; border-radius: 50%; }
/aspect-ratio: 1 sets height = width automatically.
Now 50% is a circle, regardless of width. */
This is the single most common border-radius bug in production. The CSS spec is doing exactly what it says, 50% of each axis, but designers expected "circle." aspect-ratio: 1 closes the gap.
05 Related Tools
Radius rarely ships alone. Cards have shadows that should match the curve; buttons have focus rings that follow the radius; blob shapes pair with clip-path. These adjacent tools form the full surface-treatment kit.
Box Shadow Generator
Shadows follow border-radius, design them together so a rounded card's shadow curves where the card curves, not as a sharp rectangle below.
CSS Clip-Path Generator
Where border-radius can't go, true squircles, organic blobs, diagonal cuts, clip-path picks up. The two tools complement each other.
Spacing Scale Generator
Radius and spacing should share a base unit, 8px scale → 4/8/12/16/24px radii. Tune both together for visual rhythm across the system.