Rounded corners are one of the most common CSS tasks, yet picking the right pixel value for each component type takes trial and error without a visual reference.
Loading Border Builder…
Preview common design values: 4px, 8px, 12px, 9999px
Test rounded corners on cards, buttons, and input shapes
Live preview with adjustable border and background
One-click CSS copy for direct stylesheet use
Drop the Border Builder into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.
Embed code
<iframe
src="https://www.fixtools.io/css-tool/border-builder?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="Border Builder by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
The radius value you choose communicates the visual tone of your UI. Small values like 2px to 4px read as precise and functional, common in data-heavy tools, dashboards, and enterprise software where density is prioritized over friendliness. Values from 6px to 10px are the most neutral and widely used: they signal modernity without excessive softness, which is why most design systems like Material Design, Tailwind, and Chakra use 4px or 6px as their base radius with 8px as the medium step. These values work across button sizes, input fields, and cards without looking out of scale.
Larger values from 12px to 20px work best on roomy components like modal dialogs, feature cards, and section containers where there is enough surrounding whitespace for the curves to read clearly. On a compact 32px tall button, a 16px radius produces a pill shape rather than a subtle rounding because the radius hits the height cap. For cards with more vertical space, 12px to 16px creates a noticeably rounded corner that feels softer and more consumer-facing. Product pages, marketing sites, and SaaS landing pages often lean toward this range to create an approachable aesthetic.
Pill shapes use a very large value like 9999px rather than a percentage. Setting 50% on a rectangular button produces an ellipse: the horizontal radius reaches 50% of the width, which extends further than the height allows, making the result unpredictable on different text lengths. A large fixed value like 9999px is always capped at half the element height, producing perfect semicircular ends regardless of button width. Use pill shapes for primary call-to-action buttons, filter chips, and badge labels. Inputs styled as pills are common in search bars and messaging interfaces where a softer form signals a casual, conversational context.
Box-sizing interacts with rounded corners in ways that catch designers off-guard. With the default content-box model, a button declared as width: 200px with a 1px border occupies 202px including the border. If the design system specifies button hover increases the border to 3px to signal interactivity, the button suddenly takes 206px and pushes neighbors aside, producing a visible reflow each time the cursor enters or leaves. Switching to box-sizing: border-box keeps the outer dimension fixed regardless of border width, which is the right behaviour for almost every component using rounded corners. The same applies to inputs and cards: any rounded element that might change border thickness across states needs border-box to keep its outer shape stable. Modern resets apply box-sizing: border-box universally for this reason, and the FixTools previews assume it for the recommended values.
Start with a preset radius value matching your component type: 4px for inputs and tight UI, 8px for buttons, 12px for cards in open layouts, or 9999px for pill buttons. Adjust the preview background and border to match your actual component before copying.
Step-by-step guide to css rounded corners generator:
Select a preset or enter a custom value
Choose from the common radius presets (4px, 8px, 12px, 9999px) or type a custom pixel value. The preview updates immediately to show the corner appearance.
Set the component shape
Adjust the preview element's width and height to match your actual button, card, or input dimensions. This ensures the radius reads correctly at the real component size.
Add a border and background
Enable a visible border and set a background color on the preview to see how the rounded corners interact with both. A border makes the corners clearer than a background-only preview.
Copy and apply
Copy the border-radius declaration and paste it into your component CSS. Test at multiple viewport widths if the component is responsive.
Common situations where this approach makes a real difference:
Standardizing radius values across a design system
A design system needs consistent border-radius values documented and applied across all components. Defining CSS custom properties at the root level, such as --radius-sm: 4px, --radius-md: 8px, --radius-lg: 12px, --radius-pill: 9999px, gives every component a shared vocabulary. The generator helps validate each step of the scale visually before committing to the final values in the design token file.
Pill-shaped primary action buttons
Marketing pages and consumer apps often use pill buttons for their main call-to-action. The large radius creates a friendly, approachable tone different from rectangular buttons. Using 9999px rather than 50% ensures the pill shape holds at any button width, including when the button label changes length. The generator confirms the visual result before you write the CSS.
Search input with fully rounded ends
Search inputs styled as pills are recognizable and signal a conversational interface. Applying border-radius: 9999px to the input with appropriate padding and a magnifying glass icon inside creates the standard search bar pattern. The generator lets you preview this alongside a flat 4px version to compare how each reads in the context of your navigation bar.
Feature cards on a landing page
Landing page feature cards with generous padding and icon illustrations benefit from 12px to 16px border-radius, which creates a soft container that complements the open layout. Pairing the radius with a 1px solid border and a subtle box-shadow gives each card a defined but lightweight appearance. The generator previews the card shape so you can confirm the radius before applying it across all card variants.
Get better results with these expert suggestions:
Use a radius scale that matches your spacing scale
Design systems built on a 4px base grid often use radius values that are multiples of 4: 4px, 8px, 12px, 16px. This keeps radius values consistent with margin and padding choices. Choosing arbitrary values like 6px or 10px can look correct in isolation but creates visual inconsistency when placed next to components that follow the 4px grid.
Avoid mixing percentage and pixel radii across components
Percentage border-radius scales with element size, while pixel values stay fixed. Using both in the same design system creates inconsistency: a button at 50% radius changes shape when resized while a neighboring button at 9999px does not. Pick one approach per component category and document it in your design system.
Border-radius on table cells requires special handling
Table cells with border-collapse: collapse ignore border-radius because collapsed borders are shared between cells. To use rounded corners on table rows or the table itself, use border-collapse: separate and set border-spacing. Alternatively, use div-based table-like layouts with CSS grid or flexbox, which respond to border-radius without these limitations.
Animate radius for toggle and expand interactions
A button that expands into a card on click can animate border-radius from 9999px to 12px as part of the transition. Combined with width and height transitions, this creates a morphing interaction. Keep transition durations between 200ms and 350ms for border-radius changes to feel snappy rather than sluggish.
Match radius scale to component hierarchy
Use smaller radii for inner components and larger radii for outer containers. A card at 12px radius should contain buttons at 8px and inputs at 4px. Applying the same large radius to everything flattens the visual hierarchy and makes interfaces look toy-like.
Define radius as a CSS custom property
Store your border-radius values in CSS variables: --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-pill: 9999px. Reference these across components to maintain a consistent scale and make global updates a single variable change rather than a find-and-replace.
Test at different font sizes
A 4px radius looks different on a compact 28px button versus a large 48px button. If you use relative sizing via em units, the radius stays proportional. With fixed pixels, verify the corner appearance at each button size variant in your design system.
More use-case guides for the same tool:
Other tools you might find useful:
Open the full Border Builder — free, no account needed, works on any device.
Open Border Builder →Free · No account needed · Works on any device