Round the corners of any box and copy the CSS
This CSS border radius generator rounds the corners of a preview box while you adjust the radii, then writes the shortest valid declaration. Use it for cards, buttons, round avatars, chat bubbles or organic background shapes. Radii can be set in px, % or rem, and everything runs in your browser.
How to use it
- In “Simple” mode, set the “Radius of all 4 corners”. Untick “Link all 4 corners” to give “Top left”, “Top right”, “Bottom right” and “Bottom left” their own radius.
- Switch to “Advanced (8 values)” to set a “Horizontal” and a “Vertical” radius for each corner.
- Drag the handles on the preview with a mouse or a finger. With a keyboard, Tab to a handle and use the arrow keys; Shift + arrow moves in steps of 10.
- Pick a unit and, under “Preview box”, change the width, height, colour or drop in your own image.
- Press “Copy code”, or “Copy link” to reopen the same shape later.
The presets are “Pill”, “Circle”, “Drop”, “Leaf”, “Ticket” and “Random blob”.
The full border-radius syntax
Values go clockwise, starting from the top-left corner:
| Code | Result |
|---|---|
border-radius: 12px; | all 4 corners at 12px |
border-radius: 10px 20px; | top left and bottom right 10px, top right and bottom left 20px |
border-radius: 10px 20px 30px; | top left 10px, top right and bottom left 20px, bottom right 30px |
border-radius: 10px 20px 30px 40px; | one radius per corner |
With two values, opposite corners are paired. The tool always picks the short form: 10px 20px 10px 20px becomes 10px 20px.
Eight values and the slash
Each rounded corner is a quarter of an ellipse. The four values before the slash are the horizontal radii, the four after it are the vertical radii. border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; draws a pebble-like blob: along the top edge 30% + 70% add up to the full width, and down the left edge 30% + 70% add up to the full height. “Random blob” follows the same rule with values between 20% and 80%, so every side stays fully curved.
Circles, ellipses and pills
border-radius: 50%; on a 200 × 200 px square makes a circle. On a rectangle you get an ellipse, because horizontal percentages use the width and vertical ones the height. For a pill, designers write a huge value such as 999px: when two neighbouring radii are longer than a side, the browser scales every radius down by the same factor. On a 280 × 96 px box the drawn radius ends up at 48px, half the height. The handles always sit where the curve really starts.
px, % or rem?
px keeps a fixed curve, % follows the size of the element and rem follows the root font size. Switching unit converts the numbers: 12px becomes 0.75rem (1 rem = 16 px).
FAQ
Why does my image poke out of the rounded corners?
The radius clips the element's own background, not overflowing children. Add overflow: hidden to the parent, or put the border-radius on the img itself.
How do I make a perfect circle?
Give the element equal width and height, then border-radius: 50%. The “Circle” preset sets the box to 200 × 200 px.
Do I still need -webkit-border-radius?
No. Every current browser supports plain border-radius, including the eight-value syntax.
Are my settings saved?
Your last settings stay on this device. A dropped image is never stored or uploaded. To share a shape, use “Copy link”.