Border radius generator
Tune eight radii — a horizontal and a vertical value per corner — and get the border-radius shorthand, the slash syntax and four longhand declarations, with px/percent switching and pill, circle, drop and leaf presets.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Presets
Eight radii
Each corner has a horizontal and a vertical radius; when they differ the slash syntax is used
Output options
Live preview
The preview uses the real radii in the current unit
Generated code
.card {
border-radius: 16px;
}What this tool does
- Dial in the radii for cards, buttons or avatars here and copy the border-radius declaration instead of tweaking numbers and refreshing the page.
- Make pill buttons or circular avatars: the pill (999px) and circle (50%) presets show how different the two approaches are.
- For irregular shapes, give a corner a different horizontal and vertical radius and the tool emits the horizontal / vertical slash syntax.
- When only one corner changes, switch on the longhand output and override border-top-left-radius directly instead of recomputing the whole shorthand.
Example
Input
Unit px, top left 12px/8px, top right 10px/6px, bottom right 4px/2px, bottom left 6px/3px, selector .card
Output
.card {
border-radius: 12px 10px 4px 6px / 8px 6px 2px 3px;
}When horizontal and vertical radii match on every corner only one side is written — four 16px corners collapse to border-radius: 16px;.
Frequently asked questions
What does the slash in border-radius mean?
Before the slash come the horizontal radii of the four corners (top left, top right, bottom right, bottom left); after it come the vertical ones. border-radius: 50% / 10% means half the width horizontally and 10% of the height vertically, which is how you build ellipses and other irregular corners.
px or percent — which should I use?
px gives a fixed radius that stays put as the element grows. Percentages resolve against the element box — horizontal radii against the width, vertical ones against the height — so the same value looks different on different aspect ratios. For a perfect circle use 50% on a square element.
Why does the shorthand sometimes have one value and sometimes four?
That is the CSS shorthand collapse rule: four identical corners collapse to one value, top-left equal to bottom-right and top-right equal to bottom-left collapse to two, only top-right equal to bottom-left collapses to three, otherwise four values are written. The tool applies the same rule so the output is equivalent but shorter.
Does border-radius clip the click area and overflowing children?
It clips the background and border, but not child elements — you need overflow: hidden for that. Children that overflow a rounded corner get cut by the square corner, which is the most common "my radius stopped working" cause.
What happens when a percentage radius is too large?
The spec allows up to 100%, and browsers scale the radii down proportionally when the sum of two adjacent radii exceeds the side length, so the rendered result stops matching your numbers. Use px when you need exact control.
Keywords:border-radiuscss radiusrounded cornerspill shapeslash syntax圆角生成CSS 圆角斜杠语法药丸按钮前端样式