Ttooleras

CSS Border Radius Generator

CSS Tools

Generate CSS border-radius — from simple rounded corners to organic blob shapes. Free, private — all processing in your browser.

border-radius: 16px;
Advertisement

The CSS Border Radius Generator creates rounded corners from simple uniform radius to complex blob shapes. Individual corner control (border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius) lets you make asymmetric shapes — rounded-top tabs, chat bubbles with pointed corner, CSS tooltips. Elliptical radii (two values per corner: 30px 60px) enable organic blob shapes that are nearly impossible to write by hand but look great for hero backgrounds and decorative elements. Preview live on a sample element; copy the generated CSS including shorthand formats.

Border radius is one of the most common CSS properties — but doing more than uniform rounded corners requires understanding the syntax, which is surprisingly confusing. The shorthand border-radius: 30px 60px 20px 10px / 10px 20px 30px 40px specifies different x and y radii for each corner. This tool makes all that visual: drag sliders for each corner, see the shape morph in real time, generate clean CSS.

CSS Border Radius Generator — key features

Visual corner control

Four sliders for each corner. Drag to see shape morph in real time.

Elliptical radii

Separate x-radius and y-radius per corner. Enables organic shapes beyond uniform rounding.

Blob generator

Randomize all 8 values for unique organic blob shapes. Perfect for hero backgrounds.

Unit options

Pixels, percentages, or rem. Mix units for responsive designs.

Common presets

Pill button, circle, squircle, chat bubble, tab shape, rounded card — one-click start.

Preview on multiple shapes

See result on square, rectangle, and arbitrary aspect ratio elements.

Shorthand or longhand output

Get compact shorthand or explicit corner properties based on preference.

Design system scale

Matches Tailwind shadow-sm through rounded-full for quick system-consistent rounding.

How to use the CSS Border Radius Generator

  1. 1

    Pick a preset

    Start with pill, circle, card, chat bubble, blob, or start from scratch.

  2. 2

    Adjust each corner

    Drag sliders for top-left, top-right, bottom-right, bottom-left. Symmetric or asymmetric.

  3. 3

    Enable elliptical radii (optional)

    Split each corner into x-radius and y-radius. Unlocks organic shapes.

  4. 4

    Choose unit

    Pixels for fixed sizes, percentages for responsive shapes, rem for font-size-relative.

  5. 5

    Preview

    See the shape live. Resize preview container to check responsive behavior.

  6. 6

    Copy CSS

    Shorthand or longhand, your choice. Paste into your stylesheet.

Common use cases for the CSS Border Radius Generator

Buttons and controls

  • Pill buttons: Fully rounded ends (border-radius: 9999px). Modern, friendly feel. Common in notifications, tags, pill CTAs.
  • Rounded rectangle buttons: Subtle 4-8px rounding. Material/modern default.
  • Circular icon buttons: Square element with 50% border-radius. For icon-only buttons.
  • Rounded input fields: Subtle 4-6px for inputs. Consistent with button rounding.

Cards and containers

  • Card shapes: 8-16px rounding for cards. Softer feel than sharp rectangles.
  • Modal dialogs: 12-24px for modals. More rounded emphasizes dialog separation from page.
  • Image containers with rounded corners: Rounded image thumbnails. Consistent with surrounding UI.
  • Chat message bubbles: Asymmetric rounding (3 corners rounded, 1 corner sharp for pointer).

Avatars and media

  • Circular avatars: 50% border-radius on square images. Universal pattern.
  • Rounded square avatars: 12-16% (or 12-16px for fixed-size) for friendlier square avatars (Discord-style).
  • Squircle app icons: iOS-style rounded squares (approximately 22% radius).

Creative shapes

  • Organic blobs: Elliptical radii with different values per corner. For hero backgrounds, decorative elements.
  • Speech bubbles: Asymmetric radius + pseudo-element for pointer tail.
  • Tabs: Top corners rounded, bottom sharp — classic tab shape.
  • Dropdown panels: Bottom corners rounded, top sharp (panel extends from toggle above).

CSS Border Radius Generator — examples

Uniform rounded

All corners same.

Input
12px all corners
Output
border-radius: 12px;

Pill button

Fully rounded ends.

Input
9999px
Output
border-radius: 9999px;
/* Or use 50% for element that is square */

Circle

From square element.

Input
50% all corners
Output
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

Rounded card

Soft card with consistent rounding.

Input
16px all corners
Output
.card {
  border-radius: 16px;
  overflow: hidden; /* for child images */
}

Chat bubble

Three corners rounded, one sharp.

Input
18px 18px 18px 4px
Output
.message {
  border-radius: 18px 18px 18px 4px;
  /* Bottom-left sharp for bubble pointer */
}

Tab shape

Top corners only.

Input
8px 8px 0 0
Output
.tab {
  border-radius: 8px 8px 0 0;
}

Blob shape

Organic irregular shape.

Input
Elliptical radii: 60% 40% 30% 70% / 60% 30% 70% 40%
Output
.blob {
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  background: linear-gradient(135deg, #ff6b6b, #feca57);
}

Individual corner properties

Explicit longhand.

Input
Different values per corner
Output
.shape {
  border-top-left-radius: 10px;
  border-top-right-radius: 20px;
  border-bottom-right-radius: 30px;
  border-bottom-left-radius: 40px;
}

Technical details

CSS border-radius syntax:

Shorthand (1 value = all corners):
``css
border-radius: 10px;
``

Shorthand (4 values = each corner, clockwise from top-left):
``css
border-radius: 10px 20px 30px 40px;
/* top-left, top-right, bottom-right, bottom-left */
``

Individual properties:
``css
border-top-left-radius: 10px;
border-top-right-radius: 20px;
border-bottom-right-radius: 30px;
border-bottom-left-radius: 40px;
``

Elliptical radii (2 values per corner):

```css
border-radius: 30px 60px / 10px 20px;
/* x-radius / y-radius for all corners */

border-radius: 30px 60px 10px 20px / 5px 10px 15px 20px;
/* each corner: x-radius on top, y-radius on bottom */
```

Common patterns:

Pill button (fully rounded ends):
``css
border-radius: 9999px; /* or 50% for circular based on aspect ratio */
``

Circle (from square):
``css
border-radius: 50%;
/* must be square element for perfect circle */
``

Squircle (iOS-style rounded square):
``css
/* Approximation with CSS — true squircle needs SVG or shader */
border-radius: 22%; /* not perfect but close */
``

Chat bubble:
``css
border-radius: 18px 18px 18px 4px; /* bottom-left is the pointer */
``

Rounded tab:
``css
border-radius: 8px 8px 0 0; /* top corners rounded */
``

Blob shape (organic):
``css
border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
``

Percentage vs pixel:

- Pixels (10px, 16px): fixed regardless of element size. Precise, consistent.
- Percentages (50%, 25%): relative to element dimensions. Creates circles and ovals from non-square elements.
- Rem/em (1rem, 0.5em): scale with font size. Good for inherit-like behavior.

Common pixel values:

- 2-4px: subtle rounding (inputs, small buttons)
- 6-8px: gentle rounding (default buttons)
- 12-16px: more rounded (cards, modals)
- 20-32px: strongly rounded (modern UI)
- 50% / 9999px: circles and pills

Design system scales:

Tailwind CSS example scale:
- rounded-none: 0
- rounded-sm: 0.125rem (2px)
- rounded: 0.25rem (4px)
- rounded-md: 0.375rem (6px)
- rounded-lg: 0.5rem (8px)
- rounded-xl: 0.75rem (12px)
- rounded-2xl: 1rem (16px)
- rounded-3xl: 1.5rem (24px)
- rounded-full: 9999px

Gotchas:

- Images with border-radius: Set overflow: hidden or use border-radius on an <img> directly.
- Button backgrounds extending past border: Use overflow: hidden on the button.
- Outline does not follow border-radius: By design. Use box-shadow: 0 0 0 3px color for rounded focus.
- Nested borders: Inner element border-radius should be smaller than parent to look right (parent 12px, inner 8px).

Common problems and solutions

Images overflow rounded container

Child images ignore parent border-radius. Add overflow: hidden on parent OR apply border-radius directly to the img element.

Background extends past border

Same overflow issue — absolutely positioned children, pseudo-elements can extend outside rounded border. Use overflow: hidden on parent.

Outline does not round

By CSS spec, outline is always rectangular, ignoring border-radius. For rounded focus, use box-shadow: 0 0 0 3px color instead of outline.

Percentage vs pixel mismatch

50% on a square = circle. 50% on non-square = oval. Match unit to intent: use 50% for shapes that should be circular regardless of size; use px for fixed-size rounded corners.

Nested elements look wrong

Inner element radius should be smaller than outer. Math: inner = outer - padding. Parent 12px with 4px padding → inner 8px. Otherwise the curves do not align.

Too-rounded looks like blob

Extreme rounding (40-50% on rectangles) creates shapes that are hard to read as intentional shapes. Keep consistent with your design system.

Different radii clash with design system

Random custom radii make the UI feel inconsistent. Use a scale (4, 8, 12, 16, 24, full) and apply consistently.

Elliptical syntax confusion

border-radius: 30px 60px / 10px 20px — the slash separates x-radii from y-radii. First group is x, second is y. Easy to misunderstand.

CSS Border Radius Generator — comparisons and alternatives

border-radius vs clip-path: border-radius is for uniform corner rounding. clip-path cuts any shape (polygons, curves, inset). Use border-radius for rounded corners; clip-path for complex shapes.

Percentage vs pixel radius: Pixels are fixed (responsive uses different breakpoints). Percentages are relative to element size (natural scaling). 50% on square creates circle. Use pixels for design system consistency, percentages for shapes dependent on element size.

border-radius vs mask-image: mask-image is more powerful for shaped masking (gradients, SVG shapes). border-radius is simpler for standard rounding. For 90% of cases, border-radius is sufficient.

9999px vs 50% for pills: 9999px guarantees fully rounded regardless of element height. 50% only works if height is known/constrained. For pill buttons on variable-height content, prefer 9999px.

Blob shapes via CSS vs SVG: CSS border-radius with elliptical values produces organic-looking blobs cheaply. True blob shapes (with inner curves, multiple nodes) require SVG. CSS blobs are good enough for most decorative uses.

Squircle approximation: True squircle (iOS app icon shape) is a super-ellipse — not perfectly expressible in CSS. border-radius: 22% approximates. For pixel-perfect squircles, use SVG or a mask.

Frequently asked questions about the CSS Border Radius Generator

How do I round corners in CSS?

Use border-radius: border-radius: 10px for all corners equally, or border-radius: 10px 20px 30px 40px for each corner clockwise from top-left. For circles: border-radius: 50% on a square element.

What is the difference between px and % for border-radius?

Pixels (10px) are fixed — same radius regardless of element size. Percentages (50%) are relative to element dimensions — a 50% radius on a square makes a circle; on a wide rectangle, an oval. Use px for consistent design tokens, % for shapes dependent on element size.

How do I make a circle in CSS?

Make the element square (same width and height), then border-radius: 50%. For avatars: <img> with width, height, and border-radius all set. For blocks: <div> with width: 100px; height: 100px; border-radius: 50%.

How do I make a pill-shaped button?

border-radius: 9999px (any very large value). This guarantees fully rounded ends regardless of button height. Or use border-radius: 50% if you know the button height (50% = half-height for perfectly round ends on a fixed-height element).

How do I make an organic blob shape?

Use elliptical radii (different x and y radius per corner): border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%. First four values are x-radii (clockwise from top-left), last four are y-radii. Randomize values for unique blobs.

Why does my image overflow rounded corners?

The image does not know about the parent border-radius. Fix options: (1) Add overflow: hidden to the parent container. (2) Apply border-radius directly to the <img> element. Most common: overflow: hidden on the card container.

How do I make different corners different shapes?

Use four-value shorthand: border-radius: <top-left> <top-right> <bottom-right> <bottom-left>. Or individual properties: border-top-left-radius, border-top-right-radius, etc. Example chat bubble: border-radius: 18px 18px 18px 4px (all rounded except bottom-left).

What is a squircle?

A super-ellipse shape — between a circle and a square. Used by iOS app icons and macOS dock. True squircles need SVG or custom curves. CSS approximation: border-radius: 22-25%. Close but not mathematically exact.

How do I do rounded focus indicators?

Outline ignores border-radius (always rectangular). For rounded focus: box-shadow: 0 0 0 3px var(--focus-color) inside your :focus-visible style. Pair with outline: none. Visually rounded, still accessible.

Can I animate border-radius?

Yes, but it triggers paint. For simple transitions (hover), performance is fine. For continuous animations (morphing shapes), expensive — consider SVG morphing or transform scaling instead.

Additional resources

Advertisement

Related tools

All CSS Tools

Learn more

Explore more tools

200+ free tools that run in your browser.

Browse all tools →