Home Text Tools Math & Numbers Developer Tools Date & Time Image Tools Blog
CSS Border Radius Generator

Choose the Right CSS Border Radius for Buttons, Inputs and Cards

Pick consistent corner radii for buttons, form fields and cards, understand pills, circles and nested corners, and copy the CSS.

Rounded corners change the personality of an interface. Sharp corners feel serious, large radii feel friendly, and mixed values feel accidental. Deciding by eye on every element leads to a messy result. The CSS Border Radius Generator lets you adjust corners visually and copy the code, so you can compare options quickly.

CSS Border Radius Generator FREE online toolRuns in your browser. No sign-up, nothing to install. Open the tool

Pick a scale, not random numbers

Choose a small set of values and reuse them. A common approach is 4 px for small controls such as inputs and tags, 8 px for buttons, 12 to 16 px for cards and panels, and a larger value for modals. Store them as CSS variables, for example --radius-sm and --radius-md, so a design change takes one edit.

Try values in the generator

  1. Set all four corners to the same value and watch the preview change.
  2. Compare a few options such as 4, 8 and 12 pixels on the shape closest to your element.
  3. Unlock individual corners if you need a tab or a speech-bubble shape.
  4. Copy the generated border-radius declaration.
  5. Paste it into your stylesheet, then test it on the real component and with real content.

Shapes worth knowing

  • Pill buttons: a radius larger than half the height, such as 9999px, gives fully round ends.
  • Circles: use border-radius: 50% on an element with equal width and height, perfect for avatars.
  • Cards with an image: round the card and set overflow hidden so the photo follows the corners.
  • Elliptical corners: a slash syntax like 50% / 20% sets horizontal and vertical radii separately.
  • One-sided rounding: border-radius with four values runs clockwise from the top left.

Nested corners

When a rounded element sits inside another rounded container, the inner radius should be smaller. A simple rule is inner radius equals outer radius minus the padding between them. With a 16 px card and 8 px padding, use about 8 px for the inner image or button. If both use the same value, the gap looks uneven near the corners.

Usability and accessibility notes

Very large radii on small buttons can clip the label or the focus outline, so test keyboard focus on every rounded element. Keep the text area comfortable: a tag with 2 px of vertical padding and a huge radius looks cramped. Make sure the touch target stays big enough on phones, usually at least 44 pixels in height, regardless of the corner style.

Consistency across components matters more than any single value. Review a page with forms, buttons and cards together, and ask whether it looks like one product.

Match radius to the brand

Radius is a brand signal. Financial and legal sites often stay between 2 and 6 px, while consumer apps for food, music or children go to 16 px and beyond. Look at your logo: if it has soft, round shapes, echo that in your interface, and if it is geometric and sharp, keep corners tight. Write the decision into your style guide with one example for each component, so new pages follow the same logic without a design review.

Browser support

The border-radius property is supported by all current browsers, and no prefix is needed. You can animate it, too, for example transitioning a square to a circle on hover, though subtle motion is better than a dramatic one.

Try the free CSS Border Radius Generator
Runs in your browser. No sign-up, nothing to install.

Comments (0)

No comments yet. Be the first to share a thought.