CSS Border Radius Generator

Generate border-radius CSS for uniform corners, four-corner shorthand, or elliptical slash syntax with live preview.

Last updated: August 2026 | By Workshelve Team

.box {
  border-radius: 16px;
}
Radius preview

What border-radius Controls

The CSS border-radius property rounds an element's outer corners. It works even when no visible border is drawn, so it is commonly used for cards, buttons, avatars, pills, panels, and clipped media containers.

Uniform mode applies one radius to every corner. Corner mode emits the four-value shorthand in top-left, top-right, bottom-right, bottom-left order. Elliptical mode uses slash syntax to give each corner separate horizontal and vertical radii.

This tool is one-way because valid border-radius CSS can be compressed into one, two, three, four, or slash-separated values, and real styles may also come from cascade, variables, or individual corner properties.

How the Radius CSS Is Built

1. Radius values are parsed with parseFloat and must be zero or positive.
2. Decimal values are valid for px, rem, em, and percent units.
3. Four-corner shorthand follows top-left, top-right, bottom-right, bottom-left order.
4. Elliptical syntax places horizontal radii before the slash and vertical radii after it.
16px
border-radius: 16px;
24px 6px 24px 6px
Alternating corner radius
50%
Circle or pill when dimensions allow
50% 20% 50% 20% / 20% 50% 20% 50%
Elliptical corners

Worked Example: Alternating Corners

Give a card stronger rounding on opposite corners:

Values
top-left 24px, top-right 6px, bottom-right 24px, bottom-left 6px
CSS
border-radius: 24px 6px 24px 6px;
Order

Four-value border-radius moves clockwise from top-left, unlike margin and padding shorthand, which start at the top edge.

CSS Border Radius FAQ

Can border-radius be negative?

No. CSS radius values cannot be negative, so the generator rejects negative input.

Can border-radius be zero?

Yes. Zero is valid and produces square corners. It is useful for resetting inherited or component-level rounding.

What does 50% do?

A 50% radius can create circles, ovals, or pills depending on the element dimensions. The radius is calculated relative to the box size.

What is elliptical border-radius syntax?

Slash syntax separates horizontal radii from vertical radii. For example, 50% / 20% creates a wider horizontal curve than vertical curve.

Why does corner mode use top-left first?

The four-value border-radius shorthand starts at top-left and moves clockwise: top-left, top-right, bottom-right, bottom-left.

Does border-radius require a border?

No. It rounds the element box and affects backgrounds, overflow clipping when enabled, and visible borders when present.

Can I use rem or em radius values?

Yes. rem and em are valid length units and are often useful when radius should scale with typography or design tokens.

Why is this generator not bidirectional?

Border-radius can be expressed through many equivalent shorthands and individual corner properties, so reverse parsing would be partial and potentially misleading.

Related Tools