CSS Border Radius & Box Shadow Generator
Round each corner, stack box-shadow layers and preview the result live. Copy clean CSS or Tailwind classes in one click.
Presets
Border radius
Box shadow
No shadow. Add a layer or pick a preset.
Border & colours
How to use the generator
- Start from a preset or from scratch.
- Drag the border radius sliders. Unlink the corners to round each one differently, and switch between px, % and rem.
- Adjust the box shadow: offsets, blur, spread, colour and opacity. Add up to five layers, or tick inset for an inner shadow.
- Optionally add a border, then check the result on light, dark and checkerboard backgrounds.
- Copy the CSS or the Tailwind classes into your project.
The border-radius shorthand
border-radius accepts one to four values, applied clockwise from the top-left corner:
| Value | Meaning |
|---|---|
| border-radius: 16px; | All four corners |
| border-radius: 16px 4px; | Top-left & bottom-right, then top-right & bottom-left |
| border-radius: 16px 4px 8px; | Top-left, top-right & bottom-left, bottom-right |
| border-radius: 16px 4px 8px 0; | Top-left, top-right, bottom-right, bottom-left |
| border-radius: 50%; | A circle on a square element, an ellipse otherwise |
| border-radius: 9999px; | A pill shape on any rectangle |
Understanding box-shadow values
A shadow is written as [inset] x-offset y-offset blur spread colour:
- X and Y offset move the shadow right/down (positive) or left/up (negative). A light source above the page means a positive Y.
- Blur softens the edge. 0 gives a hard-edged shadow; larger values look further from the page.
- Spread grows or shrinks the shadow before blurring. A negative spread keeps a large blur tucked under the element.
- Colour usually works best as a low-opacity black, such as
rgba(0, 0, 0, 0.12), or a tint of your background colour. - Inset draws the shadow inside the box, for pressed buttons and input fields.
Realistic elevation usually combines two layers: a small, sharper shadow for contact with the surface and a larger, softer one for depth. Separate layers with commas, as the generator does.
Design tips
- Use a consistent radius scale (for example 4, 8, 12, 16px) across buttons, inputs and cards.
- For nested rounded elements, make the inner radius equal to the outer radius minus the padding so the curves line up.
- Keep shadows subtle on light themes. On dark backgrounds, shadows are hard to see; use a border or a lighter surface colour instead.
- Large blurred shadows on many elements can slow down scrolling on low-end phones, so use them sparingly on long lists.
Frequently asked questions
How do I round only one corner in CSS?
Use a longhand property such as border-top-left-radius: 16px, or the shorthand with zeros for the other corners: border-radius: 16px 0 0 0. In the generator, unlink the corners and move just the slider you need.
How do I make a circle or pill shape?
Set border-radius: 50% on an element with equal width and height to get a circle. For a pill on any rectangle, use a very large value such as 9999px, which caps at half the shorter side.
Can I add more than one box shadow?
Yes. box-shadow accepts a comma-separated list, and the first shadow in the list is drawn on top. The generator lets you stack up to five layers and outputs them in the correct order.
Do I need -webkit- or -moz- prefixes?
No. border-radius and box-shadow have been supported without prefixes in every major browser for more than a decade, so the plain properties are all you need.
Does box-shadow follow the border radius?
Yes. Both outer and inset shadows follow the element's rounded corners automatically, which is why the preview updates its shadow shape as you change the radius.
How do I use the Tailwind output?
The Tailwind classes use arbitrary values, for example rounded-[16px] and shadow-[0_4px_12px_rgba(0,0,0,0.12)]. Paste them into the class attribute; they work in Tailwind CSS v3 and later without changing your config.
More free tools
- Character & Word Counter Count characters and words for posts, titles and SEO.
- CSS RGBA Color Generator Mix RGBA colours and copy the CSS and 8-digit hex.
- Screen Resolution Checker See your screen size, pixel ratio and colour depth.
- Weight & Mass Converter Convert kg, lbs, oz, grams, stone, tola and 40+ units.
- Unix Timestamp Converter Turn epoch seconds into a readable date and back.
- JSON Viewer & Formatter Validate, beautify and explore JSON as a tree or table.