Skip to main content
7BBusyBoss

CSS Text Shadow Generator — Visual Builder

Generate CSS text-shadow code for legible captions on images. No spread parameter—use four stacked shadows for outlines. Live preview with color controls.

No limitsZero data leaksSuper fast
2px
2px
4px
56px
Aa
text-shadow: 2px 2px 4px #000000;

You're on 7BusyBoss — 300+ free tools that run instantly in your browser. No signup, nothing uploaded.

Browse all Design Generators
About this tool

Text-Shadow Syntax: No Spread Parameter

The text-shadow CSS property takes exactly three length values and a color: text-shadow: x y blur color; — and nothing else. Unlike box-shadow, which accepts x y blur spread color (four lengths), text-shadow has no spread parameter. Developers often copy a box-shadow value expecting it to work, only to find the declaration rejected or the extra value ignored. The exact syntax is: horizontal offset (can be negative), vertical offset (can be negative), blur radius (always non-negative), and color.

Stacking Four Shadows to Build a Text Outline

Since text-shadow lacks a spread parameter, you cannot create a true outline with one declaration. Instead, stack four identical shadows at 1px offset in opposite directions: up, down, left, and right. Example:

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

This repeats the same shadow comma-separated four times, creating a 1-pixel border all around the text. If you need a thicker outline, use 2px offsets instead. This approach works, but -webkit-text-stroke is the purpose-built alternative and behaves differently — the stroke is centred on the glyph outline rather than sitting outside it, so it visually thins the letterform as it thickens the edge.

When Text Shadows Matter: Legibility on Images

The legitimate use for text-shadow is making captions readable over unpredictable background images. A soft dark shadow under white or light text improves perceived readability instantly. Be aware: a shadow does not count toward WCAG contrast ratios, which measure only the text color and background color. So your text may look readable thanks to the shadow while the measured contrast still fails accessibility standards. If the underlying contrast is poor, a shadow is a visual band-aid, not a compliance fix.

What This Tool Exposes and What It Doesn't

This generator lets you control the four fundamental parameters—horizontal offset, vertical offset, blur radius, and shadow color—with live preview showing your text at custom size over a gradient background. It does not expose multiple comma-separated shadows, meaning you cannot build and preview a full outline inside the tool (you would need to write the four-shadow declaration by hand). Heavy blurred shadows on large amounts of text also cost repainting time; use sparingly on large blocks and test performance on mobile devices. For more complex multi-layered effects, see the box-shadow generator.

How to use the CSS Text Shadow Generator

Takes about a minute. No signup, no download, your data stays in your browser.

  1. 1
    Open the tool. Scroll up to the CSS Text Shadow Generator above — it loads instantly in your browser, no install needed.
  2. 2
    Enter your values. The fields come pre-filled with realistic defaults so you can see how it works — replace them with your own numbers.
  3. 3
    Read the result. The output updates instantly. Copy or share it — nothing is uploaded to a server, everything stays on your device.

Frequently asked questions

Common questions about the CSS Text Shadow Generator.

How do I outline text in CSS?

Create four identical 1px shadows at up, down, left, and right offsets, comma-separated: text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000. Increase the 1px value to 2px or 3px for a thicker outline. Alternatively, use -webkit-text-stroke, which is centred on the glyph outline and so changes the letterform weight.

Why does text-shadow not have a spread parameter?

The property is defined with three lengths and a colour, and that is all a browser will accept. Spread makes sense on box-shadow because the shape being grown is a rectangle; growing an arbitrary set of glyph outlines has no single obvious meaning. Whatever the reasoning, the practical upshot is that a fourth length simply will not work.

How do I make white text readable on any background image?

Use a dark text-shadow with generous blur: text-shadow: 0 2px 8px rgba(0,0,0,0.8). This works visually, but remember shadows do not count for WCAG contrast ratios. If the bare text-to-background contrast is poor, the shadow is cosmetic only and may not meet accessibility standards. Check with a contrast checker tool.

Can I add a text outline with one CSS property?

Yes, with -webkit-text-stroke: 1px #000, which is a single declaration rather than four stacked shadows. Support is narrower than text-shadow, and because the stroke is centred on the glyph outline it eats into the letterform, so thin type can look noticeably lighter.

Community rating

Discussion (0)

No comments yet. Start the discussion.