A visual border radius generator
Crafting the perfect rounded edges for your web components shouldn't require guessing numbers and constantly refreshing your browser. This visual border radius generator allows you to adjust sliders and instantly see how the curves affect an element. Once you achieve the exact look you want, you can copy the optimized CSS snippet directly to your clipboard.
Because all calculations and previews are handled locally by your browser, the tool is incredibly fast and entirely private. Nothing you design or click is ever uploaded to a server.
Mastering CSS rounded corners
The border-radius property is a fundamental part of modern web design, used to soften harsh edges on buttons, images, modals, and layout containers. While it seems simple on the surface, the syntax can be surprisingly nuanced when you want to target specific corners.
This border-radius css generator helps you understand and utilize the CSS shorthand syntax effectively. When you link all corners together, the tool outputs a single value (for example, border-radius: 16px;). If you unlink the corners to create a custom shape, the generator automatically formats the CSS based on your inputs:
- Four values: If all corners are different, the CSS applies them in a clockwise order starting from the top-left (e.g.,
border-radius: 16px 8px 4px 2px;). - Two values: If the top-left matches the bottom-right, and the top-right matches the bottom-left, the tool smartly condenses the code into two values (e.g.,
border-radius: 16px 0;).
Pixels vs. Percentages
One of the most common dilemmas when writing rounded corners css is choosing the right unit. This tool lets you easily toggle between pixels (px) and percentages (%), each serving a distinct purpose in UI design.
Pixels (px) are absolute units. A 12px border radius will always look exactly the same, whether it's applied to a tiny button or a massive hero image. Pixels are the standard choice for UI components like cards, dropdown menus, and input fields because they maintain a consistent, uniform design language across your entire application. This tool allows pixel values up to 200px.
Percentages (%) are relative to the size of the element itself. A 50% border radius on a square element will always create a perfect circle, regardless of whether that square is 50 pixels wide or 500 pixels wide. If the element is a rectangle, 50% will create an elliptical oval shape. Percentages are ideal for responsive elements like profile avatars or decorative background blobs. This tool caps percentage values at 50%, as values beyond this do not increase the visual rounding effect in CSS.
Beyond basic corners: A CSS shape generator
While mostly used for subtle rounding, border-radius is also a powerful css shape generator. By unlinking the corners and mixing extreme values, you can create unique geometric shapes without needing SVG files or complex clip-paths. The tool includes several presets to demonstrate this:
- Pill: By applying an artificially high pixel value (like
9999px) to all corners, you create a "pill" or stadium shape. This is widely used for badges, tags, and modern call-to-action buttons. The browser caps the actual rounding at exactly half the height of the element, ensuring perfect semi-circles on the edges. - Circle: Setting all corners to
50%transforms a square into a perfect circle. - Leaf: By setting the top-left and bottom-right corners to
0, and the top-right and bottom-left corners to a high value (like48px), you create an asymmetrical, organic leaf shape. - Tab: By rounding only the top-left and top-right corners (e.g.,
16px) while leaving the bottom corners at0, you create a classic folder tab shape, perfect for navigation menus.
Perfecting your UI components
Rounded corners rarely exist in isolation; they are usually part of a broader, cohesive design system. A well-designed card component, for instance, pairs a subtle border radius with depth and color to stand out on the page.
Once you have generated your ideal border radius, you can combine it with other CSS effects to complete your design. Try pairing your new shape with a soft drop shadow using our Box Shadow Generator to create an elevated, floating effect. If you are styling a button or a decorative background element, you can apply a vibrant background using the CSS Gradient Generator, or find the perfect complementary solid colors with the Color Palette Generator.