CSS Border-Radius Generator
Round every corner independently or link them, switch on the elliptical x / y form for squircles, preview live, and copy the shortest correct border-radius value. Everything runs in your browser.
Output collapses to the shortest equivalent shorthand. The preview and the CSS string are built on your own device with plain JavaScript — nothing you design is uploaded, and the page keeps working offline.
What the border-radius shorthand actually says
The border-radius property rounds a box's corners, and its shorthand packs all four into one line. With four values — border-radius: a b c d — the corners are assigned clockwise from the top-left: a is top-left, b top-right, c bottom-right, d bottom-left. Give fewer values and the browser fills the rest by symmetry: one value rounds all four equally, two values set the two diagonal pairs, and three values set top-left, then the top-right/bottom-left pair, then bottom-right. This tool exposes a slider per corner (or one shared slider when linked) and writes the value out for you.
The slash and the elliptical form
Each corner does not have to be a quarter-circle — it can be a quarter-ellipse with a different horizontal and vertical radius. You write that with a slash: everything before the slash is the four horizontal radii, everything after is the four vertical radii, paired corner by corner in the same order. For example:
border-radius: 40px 20px 40px 20px
/ 20px 40px 20px 40px;
That is the trick behind squircles and soft, organic "blob" shapes: mismatched x and y radii on each corner. Turn on Elliptical above and every corner gains a separate X and Y control. When a corner's X and Y happen to be equal the slash is unnecessary, so the tool drops it automatically.
Why the collapsed value is equivalent
CSS defines the short forms to expand back to the four-value form, so 10px, 10px 10px and 10px 10px 10px 10px all render identically — the collapse is purely textual and never changes a pixel. The one rule this generator follows carefully is that it never collapses across the slash: if any corner is elliptical it keeps both the horizontal and vertical lists in full, so a lopsided shape like 20px 30px / 10px loses no radius even though each side collapsed on its own. A shorter value is easier to read, diff in a pull request, and hand-tweak later.
px versus percent
A pixel radius is fixed: 12px looks the same on a tiny chip and a large hero card. A percentage scales with the box because it is measured against the element's own width (for horizontal radii) and height (for vertical radii). That is why 50% turns a square into a perfect circle and a wide rectangle into a pill — the corners round by half of each side and meet in the middle. Percentages above what fits are clamped by the browser, which is what makes 50% a reliable circle recipe. Switch the unit above and the sliders reclamp to a sensible range for each.
Honest limits
This generator writes the border-radius shorthand and nothing else — it does not add overflow:hidden, which you still need if a child image should be clipped to the rounded corners. True Apple-style "superellipse" squircles use a smoothing curve that plain CSS border-radius cannot reproduce exactly; the elliptical form gets close but is still built from quarter-ellipses. Percentage radii interact with non-square boxes in ways that are easy to misjudge, so always confirm against your real element's aspect ratio. For related work, pair this with the Box-Shadow Generator for depth, the Gradient Generator for the fill, and the Color Converter for exact color values.