Free CSS Text Shadow Generator
The Text Shadow Generator builds CSS text-shadow effects with a live preview. Set the offset, blur, and color, then copy the CSS.
Text effects sit beside the CSS Box Shadow Generator and the CSS Filter Generator. When the effect is used on coloured text, the Color Contrast Checker is what confirms it is still readable.
How to use the Text Shadow
- 1 Set the horizontal and vertical offsets.
- 2 Set the blur radius — a small value keeps letters legible, a large one makes them look smudged.
- 3 Choose a colour, and reduce the opacity so the shadow reads as depth rather than a duplicate.
- 4 Copy the declaration. For a readable outline, add several shadows in opposite directions.
Shadows for depth versus for legibility
The two uses pull in different directions. A shadow for depth — giving a heading the impression of sitting above the page — wants an offset, a moderate blur and low opacity, exactly like a box shadow. A shadow for legibility — making white text readable over an image — wants no offset, a small blur and a dark colour, so it acts as a halo that increases separation.
Confusing them is a common mistake: a coloured blurred shadow behind small text makes it less readable, not more, because it fills the letterforms' surroundings with a medium tone rather than a dark one.
- Offset plus blur equals depth; zero offset plus blur equals legibility.
- Stack four offset shadows for an outline.
- Never use a light shadow behind dark text on a busy background.
- Sub-pixel offsets produce a crisper result than whole pixels on some renderers.
Frequently asked questions
How do I create a text outline with text-shadow?
By stacking four shadows, offset in each of the four directions by the same amount with no blur. That traces an outline around every glyph. It is the standard technique because CSS has no direct text-stroke that works reliably across browsers with good rendering quality.
Why is my shadow making the text harder to read?
Because a large blur directly behind text lowers the contrast between the letters and what surrounds them. A shadow is meant to separate the text from the background, and past a certain blur it does the opposite by filling the gap between strokes. For readability, keep the blur small and the shadow darker than the background.
Can text-shadow be animated?
It can, but not cheaply. Changing a shadow requires repainting the text on every frame, so an animated shadow is a poor use of the painting budget. Animating the text's opacity or colour is far cheaper and usually achieves the effect you wanted anyway.
Related Developer Tools
You might also need
Tools from other categories that people pair with the Text Shadow: