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.
Build and copy a shadow
- Edit each layer's horizontal and vertical offset, blur, spread, color and opacity. Choose inset when the shadow should appear inside the box.
- 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.
- 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
Sources and method
These CSS specifications provide context for shadows, colors and values.
- W3Cw3.orgCSS Backgrounds and Borders 3Box-shadow syntax, geometry and painting order.
- W3Cw3.orgCSS Color 4sRGB colors and alpha values.
- W3Cw3.orgCSS Values and Units 4CSS numeric values and pixel units.
The editor's bounded input subset is a product choice. These documents do not certify identical rendering across browsers.
Related tools
SVG to PNG
Convert a local SVG file or pasted markup into PNG, with explicit dimensions, transparency and bundled fonts.
Open tool — SVG to PNGCSS Filter Generator
Order and repeat CSS effects, compare a specimen and copy the exact filter declaration.
Open tool — CSS Filter GeneratorFluid Font Size Calculator
Create root-relative CSS from viewport endpoints and inspect the copied size model.
Open tool — Fluid Font Size CalculatorCSS Button Generator
Style native button states, inspect keyboard focus and copy HTML and CSS.
Open tool — CSS Button GeneratorCSS Border Radius Generator
Edit eight corner radii, preview a box and copy CSS in pixels or percentages.
Open tool — CSS Border Radius GeneratorCSS 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 GeneratorCSS 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 GeneratorCSS Text Shadow Generator
Build ordered text shadows, preview plain text and copy exact CSS.
Open tool — CSS Text Shadow GeneratorCSS 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 GeneratorImage 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 WatermarkCSS Gradient Generator
Create linear or radial CSS gradients with editable colors, opacity and stops.
Open tool — CSS Gradient GeneratorColor Converter
Convert supported sRGB HEX, RGB and HSL literals with alpha, explicit precision and current code Copy.
Open tool — Color ConverterImage 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 ReaderColor 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 CheckerPrint Size & Resolution Calculator
Calculate print dimensions, required pixels and effective PPI with fit or crop.
Open tool — Print Size & Resolution CalculatorAspect Ratio Calculator
Find a width-to-height ratio or calculate a matching pixel size from one target dimension.
Open tool — Aspect Ratio CalculatorImage Compressor
Try to fit a JPEG, PNG or WebP within a target file size, with measured results and optional smaller dimensions.
Open tool — Image CompressorHEIC 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 JPGImage 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 ConverterPhoto Collage Maker
Arrange local photos in a grid, adjust crops and spacing, and download PNG or JPEG.
Open tool — Photo Collage MakerRotate & 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 ImagesImage Cropper
Crop one local JPEG, PNG or WebP to exact pixels with visual and numeric controls. Download PNG or JPEG.
Open tool — Image CropperImage Resizer
Resize a JPG, PNG or WebP image by pixels or percentage, preview the result and download it.
Open tool — Image Resizer