Developer tools
Four CSS corner radii
Generate a CSS border-radius rule with four separate corner values for top left, top right, bottom right and bottom left in px or percent.
The example values can be changed. Press Calculate to update the result; you can download it as TXT or CSV and collect scenarios in this tab. Nothing is saved or sent automatically.
Result
Method:
The four values go clockwise from the top left corner and share one unit, px or %. If two neighbouring corners together are wider than the box, the browser scales them down so they fit. Elliptical corners (two values per corner) are not supported. The preview depends on your browser, so check the result on your own page. Copy the code or download it as TXT or CSV; JSON and printable HTML files also keep your inputs. Nothing is saved or sent automatically and entered addresses are never opened.
Decimal results are approximate. Inputs stay in this browser tab.
How it works
Your values are checked against the allowed ranges and written as a single CSS rule. The four values go clockwise from the top left corner and share one unit, px or %. If two neighbouring corners together are wider than the box, the browser scales them down so they fit. Elliptical corners (two values per corner) are not supported. The preview depends on your browser, so check the result on your own page. Copy the code or download it as TXT or CSV; JSON and printable HTML files also keep your inputs. Nothing is saved or sent automatically and entered addresses are never opened.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- Top left: 0–100
- 20
- Top right: 0–100
- 40
- Bottom right: 0–100
- 20
- Bottom left: 0–100
- 40
- Unit
- Pixels
Result
- CSS corner radii
- border-radius: 20px 40px 20px 40px;
Frequently asked questions
How do I set four different CSS corner radii?
Enter the top-left, top-right, bottom-right and bottom-left radii and choose one unit, px or percent. The example 20, 40, 20, 40 in px gives border-radius: 20px 40px 20px 40px;.
What range can the corner radii take?
The page states a range of 0 to 100 for the radii, with four ordered values sharing one px or percent unit.
Can I use elliptical corners with eight values?
No. There is no eight-axis elliptical input. The tool handles four ordered radii only.
Why might the browser show different corners from the preview?
A browser may reduce overlapping radii, and the preview is bounded and depends on the browser and layout. The tool gives exact declared CSS values, but rendering can differ.
Can I choose the CSS class name?
Yes. The class name is 1 to 64 ASCII characters, starting with a letter or underscore, then letters, digits, underscores or hyphens. The generated code has the class name without the preview background.
What files can I download from the corner radii tool?
You can download exact JSON, a printable HTML result and the generated code file as CSS or TXT. The tool does not execute the code or fetch any address.