CSS Border Radius Generator
Generate copy-ready CSS in your browser.
Generate copy-ready CSS in your browser.
Whatever you type in the Radius field is inserted verbatim into a border-radius declaration wrapped in a .box rule, then shown in the output box ready to copy. That means the field accepts any valid value: a single length, a percentage, one-to-four corner values, or the horizontal / vertical elliptical syntax. It runs in your browser with no network calls.
Typing 12px gives:
.box {
border-radius: 12px;
}
Typing 40px 40px 0 0 rounds only the top corners; typing 50% / 30% gives every corner an elliptical curve half the box width and a third of its height.
| Value | Result |
|---|---|
8px | All four corners, 8px |
8px 24px | Top-left/bottom-right 8px, top-right/bottom-left 24px |
8px 16px 24px 32px | Clockwise from top-left |
50% | Circle if the box is square, else ellipse |
40px / 20px | Elliptical: 40px horizontal, 20px vertical radius |
999px | Pill shape on any short element |
Percentages resolve against the element's own width (horizontal radii) and height (vertical radii), so they scale as the box resizes. Fixed lengths do not.
Prototyping card and button styles, matching a rounded avatar, building pill-shaped tags, or nailing the exact per-corner values for a speech-bubble or tab shape without counting commas by hand.
border-radius takes one to four values mapping to top-left, top-right, bottom-right, bottom-left clockwise, with missing corners mirrored. border-radius: 12px 12px 0 0 rounds only the top. You can also use border-top-left-radius for a single corner.
It separates horizontal radii from vertical radii, making each corner an ellipse. Before the slash is the horizontal radius, after it the vertical radius.
A 50% radius yields a circle only on a perfect square. On a rectangle it is an ellipse. Fix the width and height, or set aspect-ratio: 1.
No. The declaration is assembled from your input by JavaScript on this page.