What is a CSS border-radius generator?
The border-radius property rounds the corners of an element. A single value such as 8px rounds all four corners the same way, but the property can do much more: each corner can have its own radius, and each radius can be elliptical, with a horizontal and a vertical size. That second form is how the organic "blob" shapes, leaves and pills you see in modern interfaces are made, and it is hard to write by hand because the syntax packs eight numbers into two groups separated by a slash.
This generator lets you set the horizontal and the vertical radius of every corner with sliders, shows the result live on a box, and writes the shortest valid CSS for it. It works in px or in percent, can copy a Tailwind class instead of CSS, and can also read a border-radius value you paste so you can edit it. Everything runs in your browser and nothing is sent anywhere.
How to generate a border-radius
- Pick a starting point under "Starting points": Rounded, Pill, Circle, Leaf, Blob or Tab. Or paste an existing value into "Paste a CSS to edit".
- Choose the "Unit": px or %. Percent is relative to the size of the box, px is absolute. Switching unit does not convert the numbers, it only caps them at the new maximum (100 for %, 300 for px).
- For each corner (Top left, Top right, Bottom right, Bottom left) move "Horizontal radius" and "Vertical radius".
- Tick "Circular corners (vertical equals horizontal)" if you want round corners instead of elliptical ones, and "Same shape on the four corners" to edit all corners at once.
- Watch the preview and switch its background between light and dark.
- Under "Format" choose CSS or Tailwind and copy the result with "Copy CSS".
Examples
A pill button
Choose the Pill preset. The output is one value, because all eight radii are equal:
border-radius: 999px;Any radius larger than half the height behaves like half the height, so the ends become perfect semicircles at any size.
A leaf shape
The Leaf preset uses percent and rounds two opposite corners fully:
border-radius: 0 100%;The generator shortens 0 100% 0 100% to 0 100%, which CSS reads as "top left and bottom right are 0, top right and bottom left are 100%".
An organic blob
The Blob preset (also the starting value of the tool) uses different horizontal and vertical radii, so the output has a slash:
border-radius: 40% 60% 30% 70% / 60% 40% 70% 30%;The four numbers before the slash are the horizontal radii (top left, top right, bottom right, bottom left) and the four after are the vertical ones. In Tailwind format the same shape becomes:
rounded-[40%_60%_30%_70%_/_60%_40%_70%_30%]Editing a value you already have
Paste border-radius: 10px 20px / 30px 40px. The sliders load with the horizontal radii 10, 20, 10, 20 and the vertical ones 30, 40, 30, 40, and the output stays border-radius: 10px 20px / 30px 40px;.
Common mistakes
- Mixing px and % in one value. The paste field refuses it. Pick one unit for the whole shape.
- Using a unit other than px or %. Values in
remoremare not read here. Convert them first with the rem to px converter. - Expecting a circle from 50% on a rectangle.
50%on a box that is not square gives an ellipse. For a circle, make the element square, or use a pill with a large px value. - Forgetting the slash. Without it, the four values are horizontal and vertical at once. Only after a slash do the vertical radii differ.
- Reading the order wrong. The order is clockwise from the top left: top left, top right, bottom right, bottom left.
- Radius larger than the box. When radii overlap, browsers scale them down together, so the shape may look different from what you typed.
FAQ
What is the difference between border-radius in px and in %?
Pixels give the same curve on every box. Percent is relative to the box, so the curve grows with it and a non-square box gets elliptical corners. Use px for buttons and cards, and percent for shapes that must follow the size of the element.
How do I make a perfect circle with CSS?
Give the element the same width and height and set border-radius: 50%. On a non-square element use the pill value 999px to get fully rounded ends instead.
How do I round only some corners?
Set the other corners to 0. The Tab preset does it: 16px 16px 0 0 rounds only the two top corners.
Can I use the result in Tailwind or React?
Yes. Switch "Format" to Tailwind to get an arbitrary-value class. For a React style object, send the CSS to the CSS to React style converter. To cut shapes that corners alone cannot make, try the clip-path generator.