CSS Text Shadow Generator

Create soft shadows, neon glows, outlines and 3D text with layered text-shadow CSS.

CSS Text Shadow Generator tool

Shadow

px
Presets

About the CSS Text Shadow Generator

A well-chosen text shadow can make a heading readable over a photo, add a neon glow to a logo or give lettering a retro 3D look. This text shadow generator lets you type your own text and adjust the offset, blur, color and opacity of one or more shadow layers, with presets for common effects. The preview updates instantly, and the text-shadow CSS is ready to copy.

Many effects come from stacking several shadows. A neon glow layers blurred shadows in a bright color, an outline uses four sharp one-pixel shadows in every direction, and retro 3D text repeats a hard shadow one pixel further each time. Presets create these in one click, and every layer stays editable afterwards.

Change the font size, the text color and the background of the preview to match your design, because shadows look very different on light and dark backgrounds. Keep shadows on body text subtle or leave them out, as strong shadows reduce readability, and save the bold effects for large headings, banners and logos.

For shadows on boxes and cards, use the box shadow generator. To pick matching colors, try the color picker, and for colorful backgrounds behind your text, the gradient generator. The CSS uses rgba colors for transparent shadows and lists the layers in drawing order, with the first one on top, so you can paste it straight into a heading rule.

How to use the CSS Text Shadow Generator

  1. Type your textEnter the words you want to style and set the font size.
  2. Shape the shadowAdjust offset, blur, color and opacity, or pick a preset.
  3. Stack layersAdd layers for glows, outlines and 3D effects.
  4. Copy the CSSCopy the text-shadow declaration into your stylesheet.

CSS Text Shadow Generator features

  • Offset, blur, color and opacity sliders
  • Any number of shadow layers
  • Presets: soft, hard, neon, outline, retro 3D, emboss
  • Your own preview text
  • Font size, text and background colors
  • rgba transparency
  • Instant live preview
  • Runs in your browser

Common uses

  • Styling hero headings and banners
  • Creating neon sign effects
  • Adding outlines to text over photos
  • Designing retro and gaming logos
  • Improving contrast of text on images

Text shadows in practice: headlines over photos, contrast, Urdu script, letterpress effects, selected text and high contrast mode

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

Text shadows can rescue a headline placed over a busy photo, give a logo depth or create glowing neon lettering. They can also blur thin strokes, fail accessibility checks and vanish in high contrast mode. This guide works through making a headline readable over a hero image, then covers contrast, Urdu Nastaliq text, letterpress effects, long shadows, selected text and why shadows must never be the only thing keeping text readable.

A worked example: a headline over a photo

A travel site places a white headline, "Explore the Hunza Valley", over a mountain photo with bright snow and dark rocks. Over the snow, the text almost disappears. A subtle shadow, 0 1px 3px rgba(0,0,0,.6), separates the letters from bright patches without looking heavy. For full reliability, the image also gets a dark gradient overlay behind the text area, so the shadow adds polish rather than doing all the work.

Shadows and contrast checks

Contrast checkers compare text colour with background colour and ignore shadows, so white text over a bright photo may fail even when a shadow makes it readable to most people. The dependable approach is an overlay or a solid panel that gives the text enough contrast on its own, with any shadow treated as decoration.

Urdu and Nastaliq text

Nastaliq script has fine strokes and small dots that distinguish letters. A heavily blurred or offset shadow smudges these details and makes words harder to recognise. If Urdu headings need shadows, keep the blur small, the offset to a pixel or two and the colour soft, and check the result at the size readers will actually see.

Letterpress and embossed effects

A one-pixel light shadow below dark text on a mid-tone background, such as 0 1px 0 rgba(255,255,255,.5), makes letters look pressed into the surface. A dark shadow above light text produces the opposite, raised look. These subtle effects suit labels and headings in interfaces with textured or tinted backgrounds.

Long shadows

Flat-design long shadows repeat a hard shadow dozens of times, each one pixel further away. They look striking on large single words, but many layers on long text or many elements slow rendering. Keep them for one or two large headings, and check animation performance on an ordinary phone.

Selected text

Shadows stay visible when text is selected, which can make highlighted words look smeared. A rule such as ::selection { text-shadow: none; } removes the shadow while text is selected, keeping copied passages crisp and readable.

High contrast mode

Windows high contrast mode, used by people with low vision, removes text shadows completely and replaces colours with the user's chosen scheme. Text that depended on a shadow to stand out from an image may then become unreadable. Testing with forced colours turned on shows whether every heading still works.

Logos and buttons

Text shadows on button labels are rarely needed and often make text look blurry, especially at small sizes. For logos and display text set in HTML rather than images, a carefully tuned shadow can add depth while keeping the text selectable and readable by search engines.

Common mistakes

  • Relying on a shadow alone for text over photos.
  • Blurring Urdu text until its dots disappear.
  • Using many shadow layers on long passages.
  • Adding shadows to small body text.

Related tools

To confirm text remains readable, use Color Contrast Checker. To put outlined captions on pictures, try Add Text to Image, and for matching buttons, CSS Button Generator.

Colour of the shadow

A shadow in a darker shade of the background colour usually looks more natural than pure black. On a teal banner, a deep teal shadow adds depth quietly, while a black one looks dirty. Matching the shadow's hue to its surroundings is the same principle that makes coloured box shadows look better than grey ones.

Matching the light direction

If cards and buttons on a page cast shadows downward, text shadows should fall downward too. Mixing directions, such as headings with shadows to the left beside cards with shadows below, looks subtly wrong. Keeping one imaginary light source across all shadow types makes a design feel coherent.

Testing at real sizes

An effect that looks crisp on a 72-pixel heading can smear badly at 16 pixels. Preview shadows at the exact size, weight and background they will appear on, and on a phone as well as a large monitor. Many effects that work for logos should simply be switched off below a certain size.

Real text instead of images

Creating headings as images to get special effects makes them blurry on high-resolution screens, impossible to translate and invisible to search engines. Real text styled with text-shadow stays sharp at any zoom, can be copied and is read by assistive technology and search engines alike.

Privacy

Effects are designed and previewed in your browser. Your text is not uploaded or stored.

Frequently asked questions

What are the text-shadow values?

Horizontal offset, vertical offset, blur radius and color. Unlike box-shadow there is no spread value and no inset keyword. Several shadows can be combined in a comma-separated list, and the first one is drawn on top.

How do I make a neon text effect?

Use a light text color on a dark background and stack several blurred shadows in a bright color with growing blur, such as 5, 10, 20 and 40 pixels. The neon preset sets this up for you, ready to adjust.

How do I add an outline to text?

Stack four sharp shadows offset by one pixel up, down, left and right in the outline color. For thicker outlines, the -webkit-text-stroke property is another option in modern browsers, though it draws the stroke over the letters.

Does a text shadow affect readability?

Strong or blurry shadows make small text harder to read, so keep body text plain or use a very subtle shadow. A soft dark shadow can, however, improve the readability of white text placed over photos.

Can I animate text shadows?

Yes. text-shadow can be transitioned and animated with CSS, for example to make a glow pulse on hover. Keep animated glows small, because large blurred shadows are expensive to redraw on slower devices.

Do I need vendor prefixes?

No. text-shadow is supported without prefixes in all current browsers, so the single property generated here works everywhere without any extra declarations. Older prefixed versions were never needed for this property.

Is anything uploaded?

No. The preview and the CSS are produced by code running in this page on your own device. Nothing is sent to a server or stored.

Why does my shadow look different on a dark background?

Dark shadows almost disappear on dark backgrounds, while light glows stand out. Match the shadow to the background: use dark, soft shadows on light pages and bright, blurred glows on dark ones, and check both themes if your site has a dark mode.