CSS Border Radius Generator

Generate copy-ready CSS in your browser.

How this generator works

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.

Worked example

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.

border-radius shorthand

ValueResult
8pxAll four corners, 8px
8px 24pxTop-left/bottom-right 8px, top-right/bottom-left 24px
8px 16px 24px 32pxClockwise from top-left
50%Circle if the box is square, else ellipse
40px / 20pxElliptical: 40px horizontal, 20px vertical radius
999pxPill 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.

When you would use it

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.

FAQ

How do I round only some corners?

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.

What does the slash in border-radius: 40px / 20px mean?

It separates horizontal radii from vertical radii, making each corner an ellipse. Before the slash is the horizontal radius, after it the vertical radius.

Why does 50% make a circle only sometimes?

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.

Does anything get uploaded?

No. The declaration is assembled from your input by JavaScript on this page.