Free tool

Box shadow generator

Layer soft shadows, pick any color, round the corners, and copy the code as CSS, Tailwind, SCSS or React. Free, nothing uploaded.

box-shadow: 0px 8px 24px 0px rgba(0, 0, 0, 0.18);
border-radius: 16px;

Paste it into the style of any box. Press Enter on the code to copy it.

Shadow layers
px
px
px
px
%

The first layer sits on top.

Corners
Preview options
Preview background
Preview shape

The picture stays on your device. Nothing is uploaded.

Runs in your browser. Nothing you type is sent to Postfjord or saved.

Your link-in-bio page has three buttons, and they look flat, like stickers. A soft shadow would lift them. But the shadow you copied last time looks heavy and gray on this blue background. Build one here, see it on your own background, and copy the code.

How to use the box shadow generator

  1. Pick a style in Start from, like Soft card or Layered, lifelike.
  2. Move Offset X, Offset Y, Blur, Spread and Opacity. You can also type a number. On a slider, the arrow keys move it by one.
  3. Pick a Shadow color. Press Add layer to stack another shadow. The first layer sits on top.
  4. Set the Corners. Per corner takes a size in pixels for each corner. Blob makes a soft, uneven shape.
  5. Choose a format, CSS, Tailwind, SCSS, React or Variable, and press Copy.

Under Preview options you can try the shadow on a white, gray or dark background, on a card, a button or a square post, and on your own picture. Copy link to these settings gives you a link that opens the same shadow.

Where a shadow comes from

In real life a shadow is soft because light comes from many directions and the object sits a little above the surface. One blurry shadow cannot do that. It looks like a smudge.

The trick is layers. Stack a few shadows, each a little lower, wider and fainter than the one before. Together they fade like a real one. That is what Layered, lifelike does with five layers.

Why the shadow you copied looks wrong

A shadow that looks fine on white can look dirty on a colored section. It can vanish on a dark one. The usual cause is the color. A solid gray shadow is a gray patch. A black shadow at a low opacity lets the background show through, so it works on any color.

That is why this tool writes the color as rgba, with the opacity inside. Use the preview background to check it before you paste it. On dark, a shadow needs more opacity to show at all.

What this tool does and does not do

It adds your numbers into one line of CSS, in your browser. It also turns your color into red, green and blue values and your opacity into an alpha between 0 and 1. It uses no library and sends nothing anywhere.

Blur softens the edge. Zero is a hard edge. Spread makes the shadow bigger or smaller before it is softened. A negative spread pulls it in, which keeps a floating shadow under the box. The box and the shadow never push other things around, because a shadow takes no room on the page. A few shadows on a few boxes cost the browser almost nothing. Many big blurs on things that move can make scrolling feel slow, so keep those light.

It writes box-shadow and border-radius only. It does not write drop-shadow, which follows the shape of a see-through picture, or text-shadow. You can add up to six layers. Blob corners use the long, eight-number form of border-radius, and Randomize keeps opposite corners adding up to 100 so the shape stays smooth. Tailwind output uses arbitrary values, so it needs Tailwind 3 or newer.

What it means on each platform

The code runs in web browsers. A post on Instagram, TikTok, LinkedIn, YouTube, Pinterest, X or Facebook is a picture or a video, and none of those apps reads CSS.

  • Your website or link-in-bio page: paste the code. Many website builders have a custom CSS box.
  • Email: many email apps ignore box-shadow, so do not rely on it in a newsletter.
  • A post graphic: add the shadow in your design app, then post the picture. The apps show the pixels you give them.

The Square post preview is only a square to test a shadow on. For post sizes, see the social media sizes page.

FAQ

How do I make a box shadow look soft and natural?

Stack two to five layers, each with a little more offset and blur and a low opacity. Pick Layered, lifelike in Start from to see one, then change the numbers to taste.

What is the difference between blur and spread?

Blur softens the edge of the shadow, and spread makes the whole shadow bigger or smaller before it is softened. A negative spread with a large blur gives the floating look.

Which layer shows on top when shadows overlap?

The first one in the list. In this tool that is Layer 1. Layers after it sit underneath.

Can a box shadow use my brand color?

Yes. Pick a Shadow color for each layer. The tool writes it as rgba, so the opacity slider still works. Brand glow is a blue example.

Does border radius change the shadow?

Yes. The shadow follows the rounded corners of the box. Nothing cuts it off unless a parent box has overflow set to hidden.

Can I use a box shadow in an Instagram post?

No, not as code. Instagram shows pictures, not CSS. Add the shadow in a design app and post the image, or use this one on your website or link-in-bio page.

More free tools

All 101 tools

Plan the posts that send people to your page

Write once in Postfjord and schedule to Instagram, LinkedIn and more from one place. Try it free.

Start free