Favorite places of your favorite city
Home
Add to preferred sources on Google

CSS Box Shadow Generator

Build a shadow one layer at a time and copy its current CSS. Change the preview surface and view size to inspect it; those preview settings are not exported.

Shadow preview

Shadow layers

Use a dot or comma and at most two decimal places; do not include units. Use a dot or comma and at most one decimal place; do not include a percent sign.

Layer 1

px

px

px

px

Use #RGB or #RRGGBB; opacity is separate.

%

Layer 2

px

px

px

px

Use #RGB or #RRGGBB; opacity is separate.

%

CSS and preview

The first layer is foremost within its painting category. Outset shadows stay behind the box background; inset shadows stay above it and below the border. Preview settings do not change the CSS.

How the CSS is built

Each row produces one shadow in the same order. Opacity belongs to the shadow color, not the whole box.

  1. 0px 2px 4px 0px rgb(0 0 0 / 12.5%)
  2. 0px 8px 16px -4px rgb(0 0 0 / 20%)
box-shadow: 0px 2px 4px 0px rgb(0 0 0 / 12.5%), 0px 8px 16px -4px rgb(0 0 0 / 20%);

Shadow preview

Preview settings only

Use #RGB or #RRGGBB; opacity is separate.

Use #RGB or #RRGGBB; opacity is separate.

px

Fit scales the whole preview. Use the scrollable 100% view for closer inspection. Finite preview space can clip blur tails.

Your shadow is built in this page. Your values are not uploaded or saved by this tool.

Build and copy a shadow

  1. Edit each layer's horizontal and vertical offset, blur, spread, color and opacity. Choose inset when the shadow should appear inside the box.
  2. Add, duplicate or move layers to shape the result. Keep 1–8 layers; a field that is incomplete or outside this editor's limits clears the current code until corrected.
  3. Inspect the preview in Fit or 100% view, then copy the declaration. Paste it into a CSS rule for the element you want to style.

Understand each layer

Positive horizontal and vertical offsets move a shadow right and down. Blur softens its edge; zero blur leaves a sharp edge. Spread changes its size rather than its softness.

Opacity belongs to each shadow color, not the entire box. A 50 percent shadow stays exactly 50 percent in the code; its color is not converted to a rounded alpha byte.

The first layer is foremost within its painting category. Outset shadows remain behind the box background, while inset shadows remain above that background and below the border. Moving rows cannot cross those categories.

Lengths accept a dot or comma and up to two fractional digits; opacity accepts one. These are bounded editor controls, not a parser for every valid CSS expression. The generated code always uses decimal dots.

Useful shadow experiments

The starting example combines a small soft shadow at 0, 2, 4, 0 pixels and 12.5 percent opacity with a broader 0, 8, 16, -4 pixel shadow at 20 percent. Each row maps to one code entry.

For a crisp outline-like effect, use zero offsets, zero blur and positive spread on an outset layer. It is still a shadow, not an exported border property.

Try an inset layer with zero blur and a positive offset to inspect its sharp inner edge. Change the surface color and use 100% view without altering the shadow declaration.

Know what the preview shows

This editor produces 1–8 sRGB box-shadow layers in CSS pixels. It does not import CSS, generate filter drop-shadows, choose a selector or export a complete stylesheet or image.

The preview's box size, opaque colors and corner radius are context only. Your element's own geometry and background can change how the same declaration looks.

Fit scales the whole preview. Use the scrollable 100% view for closer inspection. Preview space is finite and can clip blur tails; browsers and displays need not paint identical pixels.

A transparent or collapsed shadow can be valid but invisible. If this browser cannot preview the current declaration, the tool says so rather than substituting a different effect; valid code remains available to copy.

Your shadow stays in the page

Shadow editing and code generation run locally without uploading or saving your values. Copy happens only when you choose it. The site's general privacy policy still applies.

CSS shadow questions

Keep 1–8 independently editable layers. Duplicate rows and fully transparent layers are preserved. CSS itself is not limited to eight shadows.

No. Order matters within the relevant painting category, but outset stays behind the box background and inset stays inside above that background. Reordering cannot cross those categories.

Blur softens the edge. Spread changes the shadow perimeter. Negative spread can shrink an outset shadow until it is no longer visible; that does not make the declaration invalid.

No. Copy contains only box-shadow. The preview's surface, backdrop, dimensions, radius and Fit setting help you inspect it and are not included.

Your element's size, border radius, background and browser rendering affect the effect. CSS pixels are not a guarantee of physical device pixels, and this preview does not certify identical rasterization.

No. Use the separate bounded fields for lengths, opaque hex color and opacity. A dot or comma is a decimal separator, not digit grouping; arbitrary functions, units and alpha hex are not imported.

Every shadow layer must be complete and within the editor's limits. Invalid or composing layer fields clear the previous code instead of leaving an older declaration available. A preview-only context error hides the preview but does not change otherwise valid CSS.

Sources and method

These CSS specifications provide context for shadows, colors and values.

The editor's bounded input subset is a product choice. These documents do not certify identical rendering across browsers.

SVG to PNG

Convert a local SVG file or pasted markup into PNG, with explicit dimensions, transparency and bundled fonts.

Open tool — SVG to PNG

CSS Filter Generator

Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.

Open tool — CSS Filter Generator

Fluid Font Size Calculator

Create root-relative CSS from viewport endpoints and inspect the copied size model.

Open tool — Fluid Font Size Calculator

CSS Button Generator

Style native button states, inspect keyboard focus and copy HTML and CSS.

Open tool — CSS Button Generator

CSS Border Radius Generator

Edit eight corner radii, preview a box and copy CSS in pixels or percentages.

Open tool — CSS Border Radius Generator

CSS Grid Generator

Build a bounded CSS Grid example with editable tracks, placement and named areas. Preview it, copy CSS or HTML and download the same standalone example.

Open tool — CSS Grid Generator

CSS Flexbox Generator

Build a Flexbox example with container and item controls, explicit layout axes, matching CSS and HTML, and a local complete-example download.

Open tool — CSS Flexbox Generator

CSS Text Shadow Generator

Build ordered text shadows, preview plain text and copy exact CSS.

Open tool — CSS Text Shadow Generator

CSS Transform Generator

Compose repeatable 2D CSS transforms, edit px or percentage translation and origin, inspect a reference box and copy the exact current declarations.

Open tool — CSS Transform Generator

Image Watermark

Add a text or logo watermark to a batch of images, review each result and download individual files or a ZIP.

Open tool — Image Watermark

CSS Gradient Generator

Create linear or radial CSS gradients with editable colors, opacity and stops.

Open tool — CSS Gradient Generator

Color Converter

Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.

Open tool — Color Converter

Image to Text (OCR)

Recognize printed text in local PNG or JPEG images, choose a language and review or correct the result before copying or downloading.

Open tool — Image to Text (OCR)

QR Code Reader

Read one QR code from a local PNG or JPEG and inspect its text or content bytes without opening links.

Open tool — QR Code Reader

Color Contrast Checker

Compare foreground and background colors, adjust opacity and check WCAG numerical contrast thresholds for text and essential interface details.

Open tool — Color Contrast Checker

Print Size & Resolution Calculator

Calculate print dimensions, required pixels and effective PPI with fit or crop.

Open tool — Print Size & Resolution Calculator

Aspect Ratio Calculator

Find a width-to-height ratio or calculate a matching pixel size from one target dimension.

Open tool — Aspect Ratio Calculator

Image Compressor

Try to fit a JPEG, PNG or WebP within a target file size, with measured results and optional smaller dimensions.

Open tool — Image Compressor

HEIC to JPG

Convert supported HEIC photos locally into full-size JPG copies, with quality and background controls and verified individual or ZIP downloads.

Open tool — HEIC to JPG

Image Converter

Convert supported PNG, JPEG and WebP images locally with batch targets, transparency, background and quality controls, then review and download the encoded files.

Open tool — Image Converter

Photo Collage Maker

Arrange local photos in a grid, adjust crops and spacing, and download PNG or JPEG.

Open tool — Photo Collage Maker

Rotate & Flip Images

Rotate or mirror a local batch of static PNG, JPEG and WebP images, then review and download the processed results.

Open tool — Rotate & Flip Images

Image Cropper

Crop one local JPEG, PNG or WebP to exact pixels with visual and numeric controls. Download PNG or JPEG.

Open tool — Image Cropper

Image Resizer

Resize a JPG, PNG or WebP image by pixels or percentage, preview the result and download it.

Open tool — Image Resizer
View all tools in this category