Border radius generator — CSS corner radii with live preview and copy-ready shorthand

Use this free border radius generator online to craft border-radius values for cards, modals, buttons, and image frames. Adjust top-left, top-right, bottom-right, and bottom-left in px, rem, or percent, or link corners for a single control. Use Pill for the standard 9999px chip pattern. Upload image (upload icon) to preview how a photo looks inside rounded bounds; press Copy CSS (copy icon) for optimized shorthand. Everything runs locally in your browser. For shadows around the same component, pair output with the box shadow generator; for fills and gradients behind the radius, try the gradient generator or CSS gradient tool. Explore the full design and color tools list on the home page.

Live preview — rounded corners follow your values (or Pill mode).

Live preview

Unit
Quick presets
CSS output
border-radius: 12px;

Why a dedicated border-radius tool helps design systems and handoff

Product teams express radius scales in design tokens—often 2, 4, 8, 12, 16 px or rem equivalents. Engineers still need the exact border-radius shorthand that matches mockups when corners are not uniform (for example a card with only the top corners rounded). Guessing the four-value order or whether two-value shorthand applies slows code review. This page shows the live shape, emits minimal CSS, and documents the clockwise corner order so CSS border radius generator searches resolve to a repeatable workflow. Combine radii with accessible color choices from the color picker and verify text contrast with the contrast checker.

How to use this border radius CSS generator (step by step)

  1. Choose px, rem, or %. Use rem when your design system ties radii to typography; use % for circular avatars or fluid shapes where the box size changes.
  2. Enable Link all corners for a single slider, or disable it to set each corner on its own (order: top-left, top-right, bottom-right, bottom-left).
  3. Click Pill when you need a capsule button or tag: output becomes border-radius: 9999px;, which is the usual pattern for horizontal pills of any width.
  4. Optional: use Upload image to drop a screenshot or photo into the preview so you can see clipping against a checkerboard. Remove the image when you are done.
  5. Use quick presets (None through 24px) to snap to common pixel radii; values convert to your active unit. Then press Copy CSS and paste into stylesheets, Tailwind arbitrary values, or token files.

Border radius vs layout: Flexbox, Grid, and shadows

Rounding affects paint, not document flow. Structure content first in the Flexbox playground or CSS grid playground, then apply border-radius on the container or image. Depth and elevation usually come from box-shadow layered with your radii so cards read clearly in light and dark themes.

SEO and performance: CSS radii instead of bitmap corners

Vector-friendly rounded corners scale with resolution and zoom without extra PNG or WebP assets. That supports fast LCP when you avoid oversized full-bleed images for simple rounding. Keep decorative gradients in CSS when possible using the gradient generator so marketing copy stays selectable and accessible. For inclusive color palettes before you lock radii globally, generate scales with the tint and shade generator.

Related design and developer tools

More from the design and color tools category:

  • Color Picker & ConverterPick colors and copy HEX, RGB, HSL, and CMYK values for design systems and handoff.
  • Color Contrast CheckerTest text and background pairs against WCAG AA and AAA contrast ratios for accessible UI.
  • Color Palette GeneratorFrom one base hue, build complementary, triadic, analogous, and monochrome palettes.
  • Gradient GeneratorDesign linear and radial gradients visually and copy production-ready CSS in seconds.
  • Tint & Shade GeneratorGenerate lighter tints and darker shades from a brand color for consistent UI scales.
  • Color Blindness SimulatorPreview images or palettes under common color-vision deficiencies to validate inclusive design.
  • Box Shadow GeneratorTune offset, blur, spread, color, and inset shadows with live preview and copyable CSS.
  • CSS Gradient GeneratorBuild multi-stop gradients with angles and stops—outputs clean, modern CSS gradients.
  • Flexbox PlaygroundTweak flex container and item properties and see layout updates in real time.
  • CSS Grid PlaygroundPrototype grid templates, gaps, and placement with instant visual feedback.
  • Favicon GeneratorCreate favicon.ico and PNG sizes from an image or text for every device and browser tab.

Frequently asked questions

What does the CSS border-radius property do?
The border-radius property rounds the corners of an element’s border box. You can set one value for all corners, two to four values using shorthand rules (matching top-left, top-right, bottom-right, and bottom-left in order), or slash-separated horizontal and vertical radii for elliptical corners. This generator focuses on the common four-corner radii you need for cards, buttons, and modals.
How do I read border-radius shorthand with four values?
With four lengths, the order is top-left, top-right, bottom-right, bottom-left—like going clockwise from the top-left corner. With three values, the middle number sets both top-right and bottom-left. With two values, the first sets top-left and bottom-right, and the second sets top-right and bottom-left. This tool picks the shortest valid shorthand for your numbers.
Should I use px, rem, or % for border-radius?
Use px when you want fixed rounding that does not scale with root font size. Use rem when radii should scale with accessibility or typography settings (common in design systems). Percentages are relative to the element’s own width and height, so they work well for circular avatars or fluid shapes but can look uneven on wide rectangles. Pair rounded UI with the color picker for fills and the contrast checker when text sits on colored surfaces.
What is the 9999px pill trick?
Setting a very large pixel radius (often 9999px) guarantees fully rounded ends on buttons and chips of any width, because each corner arc caps at half the side length. The Pill preset on this page outputs border-radius: 9999px, which is a common production pattern alongside spacing and shadow from the box shadow generator.
Does border-radius clip background images and overflow?
Yes. Border-radius affects painting: backgrounds, background images, and nested content can be clipped to the rounded shape when overflow is hidden or when the browser paints the rounded background. For images inside a card, apply border-radius to the image or the wrapper and test with your real assets—use Upload preview here to sanity-check a photo behind the curve.
How do I match this tool’s output with Tailwind CSS?
Copy the border-radius declaration into arbitrary properties (for example arbitrary rounded-[…] in Tailwind v3+) or map the values to your theme’s radius scale in rem. For gradients and fills that sit behind rounded shells, build backgrounds with the gradient generator or CSS gradient tool, then apply the radius you export here.
Are my uploaded preview images sent to your servers?
No. Preview images load with a file URL in your browser tab only. Nothing is uploaded to a backend; the tool is suitable for UI mockups and screenshots you do not want to share externally.
How is this related to layout tools like Flexbox or Grid?
Border-radius styles the box after layout. Use the flexbox playground or CSS grid playground to structure rows and columns, then paste border-radius from this generator on cards, panels, and media wrappers for a polished component shell.