The CSS text-shadow property applies a shadow directly to rendered text glyphs rather than to the element box that contains them.
Loading Shadow Effect Builder…
Live preview of text-shadow on sample heading text
Controls for offset, blur, and colour with alpha
Supports multiple layered text shadows
Instant CSS output ready to copy
Drop the Shadow Effect Builder into any page — blog post, product docs, intranet, school portal — with a single line of HTML. Your visitors get the full tool, processed entirely in their browser. No backend, no uploads, no signup.
Embed code
<iframe
src="https://www.fixtools.io/css-tool/shadow-effect-builder?embed=1"
width="100%"
height="780"
frameborder="0"
style="border:0;border-radius:16px;max-width:900px;"
title="Shadow Effect Builder by FixTools"
loading="lazy"
allow="clipboard-write"
></iframe>Attribution-friendly: a small "Powered by FixTools" link appears in the embed footer.
The text-shadow property applies a shadow to each individual glyph in the rendered text, using the glyph's actual rendered outline as the shadow source rather than the bounding box of the text element. The property accepts four values per shadow: horizontal offset, vertical offset, blur radius, and colour, in that order. Unlike box-shadow, text-shadow has no spread radius and no inset keyword, which makes it slightly less flexible but easier to reason about for typography work. Horizontal and vertical offsets control direction and distance from each glyph, blur radius softens the shadow edge, and colour sets both the hue and the opacity through any standard rgba() or hsla() value. Multiple shadows can be stacked by separating declarations with commas in the same property value, with the first shadow in the list appearing visually on top.
Three distinct text-shadow patterns appear repeatedly in production interfaces and represent the bulk of professional usage. First, a subtle 1 pixel offset dark shadow on white or light-coloured text over a photographic background dramatically improves readability without visually altering the text itself. A value like text-shadow: 0 1px 2px rgba(0,0,0,0.5) is almost invisible on dark text on a white background but makes light text legible against busy photo backgrounds at every exposure. Second, a saturated coloured shadow with zero offset and medium blur on dark backgrounds creates a convincing neon glow: text-shadow: 0 0 12px rgba(0,220,255,0.8) on a near-black background produces an electric blue glow that reads as illuminated rather than flat. Third, a hard offset with zero blur in a contrasting colour replicates the look of letterpress or screen-printed display type: text-shadow: 3px 3px 0 #cc3300 on dark text creates a bold retro effect popular in editorial and brand work.
One accessibility consideration applies specifically to text-shadow and is easy to overlook during design. Heavy text shadows that reduce the perceived contrast between text glyphs and their adjacent background can cause a design to fail WCAG 2.1 contrast requirements even when the base text colour technically passes the contrast checker in isolation. A white heading with a large coloured glow shadow, for instance, might meet the 4.5:1 contrast ratio for white-on-background measurement, but the bright glow effectively lightens the perceived background around each glyph and reduces real-world contrast. Always verify your text shadow choices with a contrast checker after adding the shadow, particularly for shadows with significant blur, large offsets, or saturated colours that bleed into the perceived background area around the text.
Combining text-shadow with other CSS properties unlocks polished effects that single-property styling cannot achieve. Pairing text-shadow with letter-spacing and font-weight produces editorial-grade headlines: a tight letter-spacing with a heavy weight and a subtle drop shadow creates the feeling of premium print typography. Pairing text-shadow with a coloured outline via -webkit-text-stroke produces stickered or comic-book lettering. Pairing text-shadow with a CSS transition makes shadows animate smoothly on hover, useful for interactive headlines that react to user attention. The property is composable and lightweight, making it one of the highest-leverage typography tools in the CSS toolkit.
Type or paste your heading text into the preview field, then adjust offset and blur sliders to position the shadow. Choose a colour and opacity that complements your background. Copy the text-shadow declaration when the result looks right.
Step-by-step guide to css text shadow generator:
Enter your heading text in the preview
Type the actual heading text you intend to style into the live preview panel so the shadow renders against your real content rather than generic placeholder copy. Real text reveals issues that placeholder text hides, such as ascenders and descenders interacting awkwardly with the shadow offset, or specific letterform combinations producing unexpected results. Always preview with the actual font and weight you plan to use in production.
Set offset and blur
Drag the offset sliders to set the shadow direction and distance from each glyph, then adjust the blur slider to soften or sharpen the shadow edge. For legibility shadows on photo backgrounds, keep both offset values low (0 to 2 pixels) and blur moderate (2 to 4 pixels). For neon glows, set offsets to zero and push blur higher. For retro hard-edge effects, push offsets higher and keep blur at zero for the crispest possible shadow.
Choose a colour and opacity
Select a shadow colour with the picker and use the alpha slider to control transparency precisely. For subtle legibility shadows that improve readability without altering the visual character of the text, keep alpha below 0.5 and favour dark neutral colours. For decorative effects like neon glows and embossed treatments, use higher alpha values and consider saturated brand colours rather than pure black or white for more interesting visual results.
Copy the text-shadow declaration
Click Copy CSS and paste the generated text-shadow value into your heading rule in the stylesheet. The output is browser-ready CSS that works in every modern browser without prefixes. If you stacked multiple shadow layers in the builder, the copied output contains the full comma-separated list ready to use as a single property value. For maintainability, consider storing the shadow value in a CSS custom property so multiple headings can share the same shadow definition.
Common situations where this approach makes a real difference:
Hero heading over a full-width background photo
A marketing developer is placing a large white heading over a landscape photograph that varies from light sky to dark mountain across its width. Without a shadow, the heading becomes unreadable wherever it overlaps the lighter sky areas because the white text on white background offers no contrast at all. Adding text-shadow: 0 1px 4px rgba(0,0,0,0.6) creates a subtle dark halo around each letter that makes the white text legible at every photo exposure level without obscuring the photo content itself or making the heading look heavy or stylised.
Neon sign heading for a nightclub website
A designer building a nightlife venue website needs a heading that reads convincingly as a neon sign against a near-black background. Using two stacked text-shadows, one tight at 0 pixel blur for the bright inner glow and one wide at 20 pixel blur for the outer haze, both in saturated electric teal, produces a glow effect that mimics real neon tube lighting. The heading becomes the focal point of the entire page without requiring any custom imagery or sprite assets, and the effect remains crisp at any responsive font size from mobile to desktop.
Retro game title screen typography
A developer is building a browser game title screen and wants type that recalls 1980s arcade cabinet branding and screen-printed game packaging. They set a hard 4 pixel diagonal offset with 0 blur in deep saturated orange against a dark navy background for the game title, creating a screen-print shadow effect that suits the retro aesthetic perfectly without requiring any custom imagery or sprite work. The pure CSS implementation scales cleanly to any resolution and supports localisation to other languages without rebuilding image assets for each region.
Embossed section headings on a textured background
A designer is using a light parchment texture as the background for a recipe site, and the section headings need to look as if they have been pressed into the parchment surface itself rather than printed on top of it. Combining a dark shadow below and a white highlight shadow above the heading text creates a believable embossed effect that integrates visually with the texture and looks deliberately crafted rather than digital. The result reinforces the handcrafted aesthetic of the site without requiring custom image files for each heading.
Use this when you need to add depth or legibility to heading text, create a neon glow effect, or build a retro print-style offset shadow on display typography.
Get better results with these expert suggestions:
Build retro type effects with hard 0-blur shadows
Setting blur-radius to 0 produces a perfectly crisp offset copy of the text rendered behind the original glyphs. Combine this with a bold typeface and a contrasting colour offset 2 to 4 pixels diagonally to mimic the look of screen-print or letterpress display type. The technique works best at display sizes of 36 pixels and above, where the glyph forms are large enough that the offset reads as a deliberate design choice rather than an accidental rendering artifact. Editorial publications and brand campaigns use this pattern frequently for hero headlines and section breaks.
Add a second shadow in white for embossed text
Combining a dark shadow below the text and a white shadow above creates a believable three-dimensional embossed appearance reminiscent of carved type or pressed paper. Use text-shadow: 1px 1px 2px rgba(0,0,0,0.4), -1px -1px 2px rgba(255,255,255,0.7) on text against a medium-grey background. The opposing shadow directions imply directional lighting from the upper left, with the white highlight catching the raised top edge of each glyph and the dark shadow falling away below. The effect works best on medium-grey backgrounds where both highlight and shadow have room to read.
Keep text shadows off body text
Text-shadow at body text sizes between 14 and 18 pixels actively reduces legibility rather than enhancing it. Even a subtle 1 pixel shadow at small sizes makes text appear heavier, slightly blurred, and harder to scan over long reading sessions. Reserve text-shadow exclusively for display headings at 32 pixels and above, where the glyph size is large enough to absorb the shadow without degrading clarity. Using text-shadow on body copy is one of the most common mistakes in amateur typography and consistently undermines reading comfort and accessibility.
Use CSS custom properties to make shadows theme-aware
Declare your text-shadow colours using CSS custom properties at the root level, for example --heading-shadow: rgba(0,0,0,0.3) for light mode. Override this property in a dark-mode media query or a .dark class to swap shadow colours automatically when the user changes themes. One change to the custom property definition updates every heading shadow that references the variable simultaneously, with no need to touch individual component rules. This approach scales cleanly across large design systems with many heading styles and multiple supported themes.
Use 0-offset shadows for legibility on photo backgrounds
Set both offsets to 0 and use a small blur (1-3px) with a semi-transparent dark colour to create a soft halo behind text without a visible directional shadow. This technique is standard for hero text over photography.
Stack two shadows for a neon glow
A convincing neon effect uses two shadows: one at low blur for the tight inner glow and one at high blur for the outer haze. Example: text-shadow: 0 0 4px #fff, 0 0 20px rgba(0,200,255,0.9).
Check contrast ratios after adding shadows
Text shadows that bleed colour into the perceived background area can affect how contrast-checking tools measure your text. Run a quick accessibility check after finalising any text-shadow to confirm WCAG AA compliance.
More use-case guides for the same tool:
Open the full Shadow Effect Builder — free, no account needed, works on any device.
Open Shadow Effect Builder →Free · No account needed · Works on any device