Skip to main content
BR

Border Radius Generator

Shape rounded corners visually — control all four corners independently or link them together, with instant preview and CSS output.

Did you like the tool? Thanks!
Share:

More CSS Tools

| Presets:

    

How to Use Border Radius Generator

Fine-tune the border radius of any element with four independent corner controls — top-left, top-right, bottom-right, and bottom-left — each with its own value slider and unit selector (px or %). A link-corners toggle locks all four corners to the same value for quick uniform rounding. Three preset buttons — Pill, Rounded, and None — let you jump to common configurations instantly. The preview box updates on every change so you can see the exact corner shape before copying the CSS. The output handles the CSS shorthand correctly: when all four corners match, it produces a single value; when they differ, it produces the four-value syntax following the top-left, top-right, bottom-right, bottom-left order.

About Border Radius Generator

Few CSS properties have as much impact on the feel of a user interface as border-radius. Straight, sharp, 90-degree corners read as formal, rigid, and sometimes aggressive — they are the default of the web, but they rarely represent a deliberate design choice. Rounded corners, on the other hand, feel softer, more approachable, and more human. There is a reason every major operating system, from iOS to Android to Windows, has trended toward rounded rectangles over the past decade: the human eye processes curves as more natural and less cognitively demanding than sharp angles. A 4px radius on a button is barely noticeable but subconsciously signals that the element is interactive; a 16px radius on a card gives it the friendly, pillowy look of modern SaaS design; a 50% border-radius on a square creates a circle — the foundation of avatar components. The CSS border-radius property is actually a shorthand for four longhand properties: `border-top-left-radius`, `border-top-right-radius`, `border-bottom-right-radius`, and `border-bottom-left-radius`. The shorthand accepts one, two, three, or four values following the same clockwise order as margin and padding (top-left → top-right → bottom-right → bottom-left). A single value like `border-radius: 12px` makes all four corners identical. Two values follow the diagonal pattern: first value for top-left and bottom-right, second value for top-right and bottom-left. Three values set top-left, then top-right and bottom-left together, then bottom-right. Four values set each corner independently. What most developers do not realise is that border-radius also supports an eight-value syntax using the slash separator, where the first four values set the horizontal radius and the second four set the vertical radius, enabling elliptical corners. A value like `border-radius: 50px / 25px` gives corners that are twice as wide as they are tall, creating an organic, leaf-like shape rather than a perfect quarter-circle. This tool sticks to the uniform (circular arc) radius for each corner to keep the interface approachable, but the underlying CSS mechanism is far richer than most people assume. This tool exists because getting the right corner radius by editing numbers in a text editor and refreshing the page is a slow, imprecise process. Designers often hand off specifications like "cards should have 8px rounded corners" but the reality is that the ideal radius depends on the element's size, its neighbours, the font size, and the overall design language. A 12px radius on a 48px-tall button feels very different from a 12px radius on a 300px-wide card. This generator lets you see the result immediately and experiment freely. The three preset buttons cover the most common use cases. **Pill** sets the radius to a large value (9999px or 50%) so that a rectangular element becomes fully rounded on the short sides — the classic pill-button shape used for tags, badges, and call-to-action buttons. **Rounded** sets all four corners to a moderate 12px, the default rounded-card style prevalent in Tailwind-based designs. **None** resets to 0px, restoring sharp corners. These presets are starting points, not final answers — you can always tweak individual corners after applying a preset. The link-corners toggle is a small feature with outsized usefulness. When linked, dragging any corner slider updates all four corners to the same value — the fastest way to find the right uniform radius. When unlinked, each corner is independent, enabling asymmetrical shapes like a calling card with one rounded edge (common in branding), or a tab that is rounded only at the top, or a chat bubble that is sharp on one side. The pair of unit selectors (px and %) next to each corner gives you the choice between absolute pixel rounding and percentage-based rounding. Pixel values produce the same physical curve on every screen, while percentage values scale with the element's dimensions — `border-radius: 50%` on a square always produces a circle regardless of the square's size. This is particularly useful for responsive designs where the element dimensions change at different breakpoints but you want the rounding to remain proportional. One subtle interaction to be aware of: if the combined radii of two adjacent corners exceed the element's width or height, the browser automatically scales both radii down proportionally to prevent overlap. This is called the corner-overlap algorithm and is defined in the CSS Backgrounds and Borders Module Level 3 specification. That means a 200px radius on a 100px-wide element will not actually produce a massive curve — the browser calculates the reduction factor and applies it to all corners, ensuring the shape remains valid. This tool does not simulate that reduction in the preview (the preview box is large enough that overlap is rare), but the CSS output you copy will behave according to the browser's algorithm when applied to your actual element.

Details & Tips

Corner-by-corner control and how the CSS shorthand is generated: **Corner inputs:** Four identical control groups, each labelled with the corner name (top-left, top-right, bottom-right, bottom-left). Each group contains a range slider (0-200 for px, 0-100 for %), a number input for exact values, and a px/% unit toggle. The slider and number input are bound to the same Alpine data property so they stay synchronised. **Link corners toggle:** A checkbox or toggle button labelled "Link all corners." When active, all four corner values are set to the same property (the top-left value), and dragging any of the four sliders updates all four simultaneously. This is implemented by watching all four corners and, when linked, propagating changes from the changed corner to the other three. **Preset buttons — Pill:** Sets all corners to 9999px. Using 9999px rather than 50% is a common convention because 50% on a non-square element produces an ellipse, not a pill. 9999px is effectively infinite relative to any plausible element size, so the browser rounds the short sides completely while the long sides stay straight — exactly the pill shape. **Preset buttons — Rounded:** Sets all corners to 12px, a moderate rounding that works well for cards, buttons, and containers. This is not an arbitrary choice — 12px is the default `rounded-xl` radius in Tailwind CSS and has become something of an industry standard for card components. **Preset buttons — None:** Sets all corners to 0px, removing all rounding. Useful as a reset when you have been experimenting and want to start fresh. **Unit selectors:** Each corner has a px/% toggle. When switched to %, the slider range changes from 0-200 to 0-100, because percentage-based border-radius beyond 100% is redundant (100% already rounds the element completely on that axis). The unit choice is stored per corner, so you can have top-left at 20px and top-right at 15% simultaneously — the CSS output handles the mixed-unit case by converting to the four-value syntax. **CSS shorthand logic:** The output generation function examines the four corner values and their units: 1. If all four corners have the same value AND the same unit → output `border-radius: 12px;` (one value). 2. If top-left equals bottom-right AND top-right equals bottom-left AND they have compatible units → output `border-radius: 12px 8px;` (two-value syntax). 3. Otherwise → output `border-radius: 12px 16px 8px 24px;` (four-value syntax). When corners have different units (e.g. top-left is 20px and top-right is 15%), the four-value syntax is always used, because the CSS shorthand does not support mixed units within the same shorthand value. **Preview box:** A 200×200px div with a light background and border, styled with the live border-radius value. The background is a subtle gradient or alternating colour so you can see the exact curve of each corner against both the element's fill and the page background. A dashed outline at the original 0-radius position is faintly visible behind the preview so you can see how much rounding has been applied relative to the sharp-corner baseline. **Edge cases:** - Negative values: border-radius does not accept negative values in CSS; all four corner sliders clamp to a minimum of 0. - Very large pixel values (e.g. 9999px): the CSS output is still valid; the browser's corner-overlap algorithm handles the reduction. - 50% on all corners of a square: the output is `border-radius: 50%`, which creates a perfect circle. - 0px on all corners: the output is `border-radius: 0px`, which is the CSS default and equivalent to omitting the property entirely. - Mixed units: each corner stores its unit independently. The preview uses inline styles with the exact four-value or shorthand syntax so the rendering matches the CSS output.

Frequently Asked Questions

How do I use the border radius generator?
Adjust the four corner sliders — top-left, top-right, bottom-right, bottom-left — to set the rounding for each corner individually. The preview box updates live. Click Copy CSS to get the border-radius declaration ready to paste.
What does the link corners toggle do?
When enabled, all four corners are forced to the same value. Changing any one corner updates all four simultaneously, which is useful for quick uniform rounding. When disabled, each corner can have a different radius.
What are the three preset buttons for?
Pill sets all corners to 9999px (fully rounded short sides — classic pill button shape). Rounded sets all corners to a moderate 12px. None resets all corners to 0px. Presets are starting points you can customise further.
What is the difference between px and % for border radius?
Pixel values produce the same physical curve on every screen size. Percentage values scale relative to the element's dimensions — 50% on a square always creates a circle, while 50% on a rectangle creates an ellipse.
Why does the pill preset use 9999px instead of 50%?
50% on a non-square rectangle produces an elliptical pill, not a true pill with straight long sides. 9999px is an effectively infinite value — the browser rounds the short sides completely while leaving the long sides straight, which is the classic pill shape.
Can I have different units for different corners?
Yes — each corner has its own px/% toggle. You can mix units (e.g. top-left at 20px and top-right at 15%). The output uses the four-value syntax to preserve the correct units per corner.
What happens if the border radius value is larger than the element itself?
The browser automatically scales down overlapping corner radii proportionally using the corner-overlap algorithm defined in the CSS specification. The CSS output is still valid; the browser handles the reduction at render time.
Does border-radius support negative values?
No — negative border-radius values are invalid in CSS. The sliders in this tool clamp to a minimum of 0 to prevent invalid values.
Can I create elliptical corners with different horizontal and vertical radii?
CSS supports elliptical corners using the `border-radius: 50px / 25px` syntax. This tool generates uniform circular arcs for simplicity. For elliptical corners, you can use the values from this tool as a starting point and manually adjust the slash-separated syntax.
What CSS does the tool output when all four corners are the same?
The tool is smart about the CSS shorthand — if all four corners are identical, it outputs a single value like `border-radius: 12px;`. If corners differ, it outputs the full four-value syntax in clockwise order.
Is my data sent to a server?
No — all corner calculations and preview rendering happen locally in your browser. Nothing is transmitted anywhere.
Why should I use rounded corners in my design?
Rounded corners are processed more quickly by the human visual system than sharp angles, making interfaces feel more approachable. They also help distinguish interactive elements (buttons, cards) from structural ones (layout containers, sidebars).

Also Available As

border radius generator, css border radius, rounded corners css, border radius calculator, css rounded corners, corner radius tool, pill button css, circle css, border radius preview, css shape generator

Found a Problem?

Let us know if something with Border Radius Generator isn't working as expected.

Thanks — we'll take a look.