Avatars, icon buttons, notification dots, profile placeholders: the modern interface is full of circles, and every one is the same one-line trick. Set border-radius to 50 percent and a box becomes round. Except when it does not. Sometimes the result is an egg, sometimes a rounded square with one flat corner, and the CSS looks identical to the version that worked elsewhere.
This guide explains the one condition the trick depends on, walks through setting it with the free Border Radius Generator on Ovatly, and covers the two failure shapes. The generator runs in your browser and outputs a single border-radius declaration.
Contents
- Quick answer
- What 50 percent actually does
- The square is not optional
- Failure shape one: the rectangle ellipse
- Failure shape two: the forgotten corner
- How to create the circle, step by step
- Worked example: an avatar and a banner
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
To create a circle with CSS: make the element square, with width and height equal, then set every corner radius to 50 percent. In the Border Radius Generator, that means all four sliders at 50, which produces the declaration border-radius: 50%;. Apply it to the square element and the four corner curves join into one continuous circle. Skip the square and the same setting draws an ellipse. Leave one corner below 50 and the ring never closes.
What 50 percent actually does
A corner radius of 50 percent means the curve at that corner runs halfway along each of the two sides it connects. Put 50 percent on all four corners and each side is fully claimed by the curves at its ends, meeting exactly in the middle. Four quarter curves join into a single ring with no straight edge left.
Each corner's curve is scaled by the element's own size: the horizontal reach is a percentage of the width, the vertical reach a percentage of the height. A true circle needs those two reaches to be the same length, which is only possible when width and height are equal.
The square is not optional
It is tempting to treat the square as a detail, because the declaration feels like the technique. It is the other way round: the declaration is trivial, the square is the technique. A 96 by 96 px avatar with 50 percent corners is a circle; a wider element with the identical declaration is an ellipse, as the worked example below shows with real numbers.
Making the element square is your CSS, not the generator's: it emits the border-radius declaration and nothing else, with no sizing, cropping or reshaping of the element. Set equal width and height in your stylesheet, then let the declaration do its one job.
Failure shape one: the rectangle ellipse
The ellipse is the most common failure because it looks deliberate at a glance. On a rectangular element, 50 percent corners still meet in the middle of every side, so the shape is smooth and closed, just stretched. On slightly rectangular elements, say 120 by 100 px, the result is a subtle oval.
If you genuinely want the ellipse, it is a legitimate shape and this is how to make one. If you wanted a circle, no radius adjustment will fix it: the fix lives entirely in the dimensions. Bring width and height together and the ellipse tightens into a circle on its own.
Failure shape two: the forgotten corner
The second failure is one corner set lower than the rest, usually because three sliders were dragged and the fourth was missed. With three corners at 50 percent and one at, say, 20 percent, the ring cannot close. Around the small corner, straight sections of the original edges survive, and the eye goes straight to the asymmetry.
The corners are read in a fixed order, top left, top right, bottom right, bottom left, and mismatches often come from editing a different corner than the one being watched. The check is quick: a true setting shows a clean ring in the preview. Any flat spot means a corner is below 50.
How to create the circle, step by step
- In your own CSS, give the element equal width and height. The whole result depends on this step, and no tool does it for you.
- Open the Border Radius Generator and set all four corner sliders to 50 percent.
- Check the preview for a clean circle with no straight edge surviving. A flat section means one corner is below 50.
- Copy the declaration the generator produces,
border-radius: 50%;, and apply it to your square element. - View the result at its real size in your page. A circle correct at 96 px is correct at any size, because the percentage scales with the element.
One variation: Fancy mode splits each corner into horizontal and vertical values, so a circle there means both sets at 50 percent. Fancy mode earns its keep on deliberate asymmetry, like the blob built from horizontal values of 30, 70, 70, 30 against vertical values of 30, 30, 70, 70. For a plain circle, the standard single value is simpler and safer.
Worked example: an avatar and a banner
Take a profile avatar displayed at 96 by 96 px. Set all four corners to 50 percent in the Border Radius Generator and apply the declaration. Each curve reaches 48 px along both axes, they meet at the midpoint of every side, and the photo presents as a clean circle.
Now apply the identical declaration to a banner image shown at 160 by 96 px. The horizontal reach of each corner is 80 px and the vertical reach is 48 px, so the result is an ellipse, smooth but visibly stretched. If that banner needs to end as a circle, present it in a square box first; the declaration is already correct.
Limitations and honest tradeoffs
The generator produces one thing: a border-radius declaration in percentages, with no pixel output. Its own guidance offers a bridge, replacing the % sign with px as a starting point, but a circle never needs it: 50 percent is correct at every size.
It also does not touch the element itself: squareness, sizing, and fitting a rectangular photo into a square box all happen in your markup and CSS. If the box is square and the corners are at 50, the rendered shape is a circle, every time. The simplicity is real, but it rests entirely on the square.
Common mistakes
- Applying 50 percent to a rectangle and expecting a circle. You get an ellipse, because the curves scale with different sides. Equalise the dimensions.
- Missing the fourth corner. Three corners at 50 and one below it leaves straight edge surviving and breaks the ring. Check for flat spots.
- Expecting the generator to make the element square. It emits the declaration only. Width and height are your CSS.
- Setting only the horizontal values in Fancy mode. A circle needs both the horizontal and vertical sets at 50 percent.
- Calling a pill a failed circle. On a wide, short element like a button, 50 percent correctly produces a pill: the right shape for that box.
FAQs
Why does my circle look like an oval? Because the element is not square. At 50 percent, the horizontal curve is half the width and the vertical curve is half the height; when those halves differ, the shape is an ellipse. Make width and height equal and the same declaration draws a circle.
What happens if one corner is set below 50 percent? The four curves no longer join into one continuous ring. The smaller corner stays flatter, straight edge survives next to it, and the shape reads as a rounded square with one odd corner.
Can I turn a rectangular photo into a circle with this? The radius rounds the element's box, so the element itself has to be square first. Getting a rectangular photo into a square box is a sizing and cropping job in your own markup and CSS. The generator's part is only the declaration.
Does the generator output pixel values for the radius? No, it works in percentages only. For a circle that is no hardship, because 50 percent is the native value at any size. If you ever need pixels as a starting point, replace the % sign with px and adjust, but a circle never needs the conversion.
Is anything uploaded when I use the generator? No. The generator runs in your browser and produces a line of CSS; nothing is sent anywhere.
Conclusion
A CSS circle is two facts held together: every corner at 50 percent, and an element that is perfectly square. The Border Radius Generator handles the first in seconds and shows you the ring in its preview; the second is one line of your own CSS, and skipping it causes nearly every oval that was meant to be round. When corners go wrong in less obvious ways (oversized radii, swapped corners, pinched nested elements), our guide to border radius mistakes works through each one. For more guides, see our Website and Webmaster Tools guides, which pair each technique with the free tool that performs it.
References
- MDN Web Docs, on the border-radius property and how percentages resolve against the element's size: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
- W3C CSS Backgrounds and Borders Module, on corner curve geometry: https://www.w3.org/TR/css-backgrounds-3/#corners