CSS Text Shadow Generator

Create CSS text shadow effects visually. Stack multiple shadows, pick presets, and copy ready CSS instantly.

Quick Presets
CSS Toolkit
1 layer
text-shadow: 2px 2px 4px rgba(0,0,0,0.50);

What is CSS Text Shadow?

The CSS text-shadow property adds one or more shadow effects directly to text. It controls horizontal and vertical offset, blur softness, and color. Unlike box-shadow, text shadow follows the exact shape of each character rather than the element's bounding box.

Text shadow is used for subtle depth on headings, glowing neon effects, hard retro shadows, legibility improvements on image backgrounds, and decorative multi-layer typography. Multiple shadows can be stacked by separating each value with a comma.

Text Shadow Syntax

text-shadow: offset-x offset-y blur-radius color;

  • offset-x - Horizontal distance. Positive moves shadow right, negative moves left.
  • offset-y - Vertical distance. Positive moves shadow down, negative moves up.
  • blur-radius - How soft the shadow edge is. 0 = sharp. Higher values spread and soften. Optional, defaults to 0 if omitted.
  • color - Any valid CSS color. Use rgba() to control opacity. Optional, defaults to the element's color if omitted.

CSS Text Shadow Examples

Subtle Legibility Shadow

text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);

Glow Effect

Zero offset and a colored blur creates a neon glow. Commonly used in dark UI designs:

text-shadow: 0 0 10px rgba(124, 106, 247, 0.8);

Hard Retro Shadow

Zero blur and full opacity creates a solid offset shadow, popular in retro and poster-style typography:

text-shadow: 3px 3px 0px rgba(0, 0, 0, 1);

Embossed / Debossed Effect

/* Embossed */
text-shadow: -1px -1px 1px rgba(255,255,255,0.3), 1px 1px 1px rgba(0,0,0,0.5);

/* Debossed */
text-shadow: 1px 1px 1px rgba(255,255,255,0.3), -1px -1px 1px rgba(0,0,0,0.5);

Stacked Multiple Shadows

/* 3D layered shadow */
text-shadow:
1px 1px 0 #555,
2px 2px 0 #444,
3px 3px 0 #333,
4px 4px 6px rgba(0,0,0,0.4);

Outline Effect

Four shadows in each direction create a text outline without using -webkit-text-stroke:

text-shadow:
-1px -1px 0 #000,
1px -1px 0 #000,
-1px 1px 0 #000,
1px 1px 0 #000;

Text Shadow vs Box Shadow

Both add shadow effects but work on different targets:

  • text-shadow - Follows the shape of individual characters. No inset option. Used only on text.
  • box-shadow - Follows the element's rectangular box. Supports inset. Works on any element.

Performance and Accessibility

Text shadows are rendered by the GPU and are generally performant. However, avoid animating text-shadow in large quantities, as it can cause repaint. For accessibility, ensure sufficient contrast between text color and background even when shadows are present. Do not rely on shadow alone to create legibility.

How to Use This Generator

  1. Click a Quick Preset to start with a ready-made effect, or build from scratch
  2. Type your own text in the Preview Text field to test with real content
  3. Switch the Background to match your actual site (Dark, Light, or a custom color)
  4. Change the Font Family and Font Size to match your typography
  5. Adjust the sliders in each Shadow Layer, or click Add Shadow Layer to stack effects
  6. Toggle individual layers on and off to compare results
  7. Click Copy CSS and paste into your stylesheet

Frequently Asked Questions

Does CSS text-shadow support inset?

No. Unlike box-shadow, the text-shadow property does not accept the inset keyword. It only creates outer shadows. For an inner or cutout shadow effect on text, you need SVG filters or image-based techniques.

How do I add multiple text shadows?

Separate each shadow declaration with a comma. Shadows are layered from first (top) to last (bottom): text-shadow: 1px 1px 2px red, 0 0 8px blue, 0 0 20px blue;

Can I animate text-shadow with CSS?

Yes. text-shadow is animatable using CSS transitions or animations. However, animating shadows is more expensive than animating transform or opacity, so use it sparingly for performance-sensitive animations.

What is the difference between text-shadow and filter: drop-shadow()?

text-shadow applies only to text and follows character shapes. filter: drop-shadow() applies to the entire element including any transparent or semi-transparent areas. Both produce similar visual results on plain text, but drop-shadow() is more flexible for complex elements.

Does text-shadow work on all browsers?

Yes. text-shadow is supported by all modern browsers and has been since IE10 (basic support). No vendor prefixes are required. Multiple shadows and rgba colors are also universally supported in modern browsers.