Text Shadow Generator
Create CSS text shadows with a visual editor and presets. Doubles as a CSS font shadow generator.
Maintained by Aygul Dovletova
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
Driving the Text Shadow Generator
- Type your preview copy and pick a font size. Real text reveals problems that Lorem Ipsum hides - thin strokes, diacritics, wide letterspacing.
- Set X offset, Y offset, and blur. Offsets move the shadow; blur softens it. Unlike
box-shadow,text-shadowhas no spread value - you compensate with layered shadows instead. - Pick the color plus opacity. Fully opaque shadows on text almost never look right. Start at 30-50% alpha.
- Stack layers with "+ Add shadow". Multiple comma-separated shadows are how neon, outlines, letterpress, and retro 3D text are built.
- Load a preset (glow, neon, 3D, emboss) to see a worked example, then tweak from there.
- Copy CSS and paste into your stylesheet - output is a standard
text-shadowdeclaration with no vendor prefixes needed.
How text-shadow is rendered
text-shadow is defined in CSS Text Decoration Module Level 3 and accepts a comma-separated list of shadow values, each with X offset, Y offset, optional blur radius, and color. Crucially, there is no spread parameter - the shadow always follows the actual glyph outlines produced by the font renderer (HarfBuzz, CoreText, or DirectWrite depending on your OS). That means ligatures, italic slants, variable-font weight axes, and emoji are all shadowed correctly.
Internally the browser renders the text twice: once as the shadow color with the glyph path offset and blurred using a Gaussian kernel, once as the foreground color on top. Layered shadows stack back-to-front like box-shadow, so the first shadow in the list renders on top. On modern browsers the blur pass runs on the GPU, but very large blur radii (above ~30px) still cost measurable paint time - Chrome\'s DevTools Performance panel will show the hit in the "Paint" and "Composite Layers" rows. For plain drop-shadow text there is no layout impact, only paint.
Realistic uses for text-shadow
- Hero text over photos - a subtle dark shadow rescues readability when you cannot control the background image.
- Neon signage effects stacking 3-6 same-color shadows with growing blur radii.
- Retro 3D typography using a tight staircase of 1px offsets:
1px 1px 0 #222, 2px 2px 0 #222, 3px 3px 0 #222. - Letterpress / emboss - a 1px white shadow with a negative Y offset makes dark text look carved into the page.
- Faux outlines by stacking four 1px shadows at +X/-X/+Y/-Y for browsers where
-webkit-text-strokeis not enough. - Focus and hover emphasis on big headline links - a growing glow signals interactivity without a layout shift.
Pitfalls worth knowing
- WCAG contrast still applies. A shadow does not count as foreground contrast - screen readers ignore it entirely and low-vision users may not perceive it. Keep the underlying text-to-background ratio at 4.5:1 (normal) or 3:1 (large) even if the shadow makes things "look" legible.
- Sub-pixel jitter on thin fonts. Half-pixel offsets like
0.5px 0.5pxon light fonts can produce fuzzy doubling on non-retina displays. Round to whole pixels for body sizes; sub-pixel is fine for headlines. - Blur radius must be non-negative. A negative blur is invalid and the whole declaration is dropped. Browsers do not warn you - the text just renders without a shadow.
- No inset keyword. Unlike
box-shadow,text-shadowhas no inner-shadow mode. "Pressed in" text effects are faked by combining a dark shadow at the top with a light shadow at the bottom, or viabackground-clip: text. - Emoji get colored over. On some systems multi-color emoji glyphs have their color flattened in the shadow pass, which can look odd if you shadow text that contains emoji.
- Print stylesheets. Many printer drivers ignore
text-shadow- never rely on a shadow as a meaningful distinction on@media print.
Background on the property (also: CSS font shadow generator)
text-shadow first appeared in CSS2 (1998) but was removed in CSS 2.1 because no browser actually shipped it; it returned in CSS3 and was implemented in Safari 1.1, Firefox 3.5, Chrome from launch, and IE10. The current spec lives in the CSS Text Decoration Module Level 3, which also covers text-decoration-line, text-underline-offset, and related typographic effects. Browser support is now 100% on caniuse.com with no prefixes. The specification is deliberately simple - two offsets, one blur, one color - which is why complex effects are built by stacking multiple shadows rather than with additional parameters. For accessibility, WCAG 2.2 Success Criterion 1.4.11 "Non-text Contrast" does not apply to decorative text shadows, but 1.4.3 "Contrast (Minimum)" still governs the underlying text/background pair.
Text-shadow vs the alternatives
text-shadow is the right tool for drop shadows, glows, and stacked offsets on actual text. For a crisp outline, -webkit-text-stroke is better - it\'s supported everywhere except old Firefox and gives a single-pass outlined glyph. For colored outlines plus fill plus shadow (common in gaming and title cards), SVG <text> with stroke and filter beats CSS hands-down because you can control stroke alignment and miter behavior. For animated text lighting, CSS variables interpolated in @keyframes remain the simplest route - Houdini gets you per-frame control but adds a lot of complexity. Where CSS text-shadow loses out is high-end typographic effects like variable blur per letter or along-baseline shadow warping - those belong in Canvas 2D, WebGL, or an image editor. And remember the decision tree: if the shadow is part of the brand logo, export an SVG; if it\'s per-page headline styling, text-shadow is cheaper and more maintainable than any asset pipeline.
Frequently Asked Questions
Why does text-shadow have no spread parameter?
Because <code>text-shadow</code> follows the exact glyph outlines rather than a rectangle, a "spread" would mean dilating each path inward and outward - an expensive and ambiguous operation. The CSS Text Decoration Level 3 spec deliberately keeps the syntax to offset-x, offset-y, blur, and color. To fake spread, stack several shadows with progressively larger blur radii or use <code>-webkit-text-stroke</code> for a true outlined effect.
Does a text-shadow satisfy WCAG contrast requirements?
No. WCAG 2.2 Success Criterion 1.4.3 calculates contrast between the foreground text color and the effective background color, ignoring decorative shadows. A white headline on a busy photo with a blurry dark shadow may look readable to sighted users but still fails for low-vision users and for screen magnification. Treat the shadow as a bonus polish layer and always meet the 4.5:1 (normal) or 3:1 (large) ratio against the literal pixels behind the text.
How do I make a neon glow effect?
Stack three to five same-color shadows with growing blur radii and zero offset - something like <code>text-shadow: 0 0 4px #0ff, 0 0 10px #0ff, 0 0 20px #0ff, 0 0 40px #0ff;</code>. The inner shadows build saturation near the letterforms; the outer ones provide the diffuse halo. Animating the alpha of the outer stops with <code>@keyframes</code> gives you a flickering tube effect. Pair with a dark background because glow on light backgrounds washes out.
Can I use text-shadow instead of text-stroke for outlines?
You can approximate an outline by stacking four 1px shadows at the four compass directions: <code>1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000</code>. It works but is jagged at larger sizes because the four samples do not smoothly fill in the diagonals. For a true outline, <code>-webkit-text-stroke: 1px black</code> is better - it's supported in Chromium, Safari, and Firefox 49+ despite the prefixed name.
Are my typed words and colors stored anywhere?
No. The preview text and every shadow parameter live in Preact component state that never leaves your browser. The generated CSS is produced by a local template literal and rendered through an inline <code>style</code> attribute on the preview element. There is no API endpoint that receives the text, no analytics event with your words.
How expensive is text-shadow for performance?
Negligible for one or two layers with small blur radii - the browser rasterizes the shadow once and composites it cheaply. Costs rise quickly with large blur (above ~30px), many stacked layers (six-plus), or very long text with shadows applied to every character. In Chrome DevTools Performance you'll see the impact in the "Paint" phase. For hot paths like animated hero headlines, pre-render the shadowed text as an SVG asset.
Why do my letterpress effects look off in dark mode?
The classic letterpress recipe - a 1px white shadow on dark text - inverts its meaning when the background flips. The shadow now sits on a dark background where it reads as a bright highlight, not an embossed groove. Wrap your shadow rule in <code>@media (prefers-color-scheme: dark)</code> and swap the shadow color to something darker than the background, or to a slightly-lighter-than-background tone for an inverse "carved in" look.
Can text-shadow be animated smoothly?
Yes - every component value (offsets, blur, and the color) is animatable and interpolates smoothly between keyframes. Browsers animate between shadow lists position-by-position. If the lists have different lengths, the browser pads with transparent shadows, which can produce abrupt pops - always keep the layer count constant across keyframes for best results.
Is this the same as a CSS font shadow generator?
Yes. "Font shadow" is a casual way to say "shadow applied to text", and in CSS every shadow on text is produced by the <code>text-shadow</code> property - there is no separate <code>font-shadow</code> rule. Anything a "CSS font shadow generator" could do (drop shadow, glow, stacked 3D effect, emboss) is just one or more comma-separated <code>text-shadow</code> layers, which is exactly what this tool outputs. If you also need to shadow the shape around the text (the background rectangle) use the box-shadow generator instead.
More CSS & Design
Aspect Ratio Calculator
Calculate and visualize aspect ratios for any dimensions.
Open toolBlob Shape Generator
Generate organic blob shapes as SVG.
Open toolBorder Radius Generator
Create CSS border-radius with a visual corner editor.
Open toolCSS Box Shadow Generator
Create CSS box shadows with a visual editor. CSS box-shadow generator, shadow maker and box-shadow builder with live preview, multi-layer support and Material elevation presets.
Open toolColor Palette Generator
Generate harmonious color palettes, Tailwind-style 50-900 scales and design-system tokens from any base hex color. Also a hex color palette generator (Farbpalette Generator auf Deutsch).
Open toolColor Picker
Pick colors visually and get HEX, RGB, and HSL values.
Open tool