Skip to main content
AllDevToolsHub

CSS Border Radius Generator

100% Local

Generate border-radius CSS with per-corner control and live shape preview.

CSS Border Radius Generator
12
12
12
12
px
px
px
px
border-radius: 12px;
Tailwind equivalent:
Try:
This tool runs entirely in your browser. Your input is never uploaded, logged, or sent to AllDevToolsHub or anyone else, and it keeps working offline once the page has loaded.

Drag corners or type pixel values. The preview updates live and the CSS copies to clipboard.

Overview

What is CSS Border Radius Generator?

Adjust all four corners independently or linked. Includes 10 presets (Pill, Leaf, Bubble, Squircle...), shorthand toggle, and Tailwind class suggestions.
FAQ

Frequently Asked Questions

Reference

Technical Deep Dive

DESIGN TOOLS

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 ValueAll Corners8px
2 Values[TL,BR] [TR,BL]8px 16px
3 Values[TL] [TR,BL] [BR]8px 16px 4px
4 ValuesTL, TR, BR, BL8px 4px 2px 0

02 Common Shape Archetypes

Pill: 9999px Circle: 50% Leaf: 0 100% Squircle: 30% / 50%
  • 💊
    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: 9999px always 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 to clip-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. Use aspect-ratio: 1 alongside border-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 set outline-offset and let modern browsers' outline follow the radius (Chrome 94+, Safari 16.4+).

04 Worked Examples

EXAMPLE 1 · ELLIPTICAL SYNTAX FOR ORGANIC SHAPES
A symmetric blob from four asymmetric elliptical corners:
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% /


Or a leaf shape, zero on two opposite corners, full on the others:

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.




EXAMPLE 2 · WHY IOS USES SUPERELLIPSE AND CSS CAN'T (YET)

CSS border-radius, quadratic Bézier curve at each corner:

border-radius: 22%;
/
Distinguishable "kink" where the curve meets the straight side. /

Apple's iOS icons, true superellipse, no kink, continuous curvature:

/ 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.




EXAMPLE 3 · "50% ON A NON-SQUARE" GIVES AN ELLIPSE, NOT A CIRCLE

A 200×100 avatar with naive 50%:

.avatar { width: 200px; height: 100px; border-radius: 50%; }
/
Result: ellipse, flattened circle. /

Force squareness, then the 50% renders as a true 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.

You Might Also Need