CSS text-shadow generator

Build CSS text-shadow with several layers (neon, retro, emboss, outline), preview it with your own text on a light and a dark background and copy the

loading CSS text-shadow generator
About this tool

What is a CSS text-shadow generator?

A text-shadow generator builds the text-shadow value for you. The property draws one or more shadows behind the letters of a text. Each shadow has a horizontal offset, a vertical offset, a blur and a color. Stacking several of them gives effects such as neon glow, retro offset, embossed lettering and outlines. Writing those by hand is trial and error, so this tool shows the result on your own text as you change the sliders.

Unlike box-shadow, a text shadow has no spread and no inset. That is a limit of CSS, not of the tool, and it is why the editor shows fewer controls here than in the box-shadow generator. To get an outline or a thick glow you stack layers instead.

The preview shows a sample text on a light and on a dark background. You can change the sample to a word from your own design, such as a heading or a logo name. Copy plain CSS or a Tailwind arbitrary-property class when you are happy with it. You can also paste a text-shadow you already have and keep editing it. Everything runs in your browser and nothing you type is sent anywhere.

How to build a text-shadow

  1. Choose a look in "Starting points" (Neon, Retro, Soft, Emboss or Outline), or paste a declaration into "Paste CSS to edit it".
  2. Type your own word in "Sample text" so the preview matches the real heading.
  3. Edit "Layer 1". "Horizontal offset" and "Vertical offset" move the shadow in pixels, and "Blur" softens it. Offsets can be negative.
  4. Set the "Color" and the "Opacity" of the layer. A glow uses a bright color with a large blur, and a hard offset uses blur 0.
  5. Press "Add a layer" to stack another shadow. It copies the last layer, two pixels lower and four pixels blurrier. "Remove" deletes a layer, and with no layers the result is none.
  6. Look at the light and dark backgrounds in the preview. Legibility of the text itself matters more than the effect.
  7. Pick "CSS" or "Tailwind" under "Format" and press "Copy CSS".

Examples

Neon glow

The Neon look stacks a white core and two orange halos that get wider:

text-shadow: 0 0 4px #ffffff,
    0 0 12px #ffb224,
    0 0 24px #ffb224;

It works best with light text on a dark background, so check the dark preview.

Retro offset

The Retro look uses two hard layers, with no blur, one behind the other:

text-shadow: 3px 3px 0 #ffb224,
    6px 6px 0 #3b82f6;

In the tool each layer is written on its own line when there is more than one.

Soft shadow and Tailwind

A single soft layer lifts a heading off the page without a visible effect:

text-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);

In Tailwind format the tool writes an arbitrary property, because text-shadow has no built-in utility in every setup:

[text-shadow:0_2px_4px_rgba(0,_0,_0,_0.35)]

Emboss and outline

Emboss pairs a light highlight below with a dark edge above:

text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8),
    0 -1px 0 rgba(0, 0, 0, 0.4);

Outline uses four hard layers, one for each diagonal, to draw a thin border around the letters:

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

Common mistakes

  • Pasting a spread value. A text shadow takes at most three lengths: x, y and blur. A fourth number is an error in CSS and the paste is rejected.
  • Using em units or a bare number. The tool reads px only, and a non-zero number with no unit, such as 2 2 4px, is rejected.
  • Making the text hard to read. A heavy glow on small body text hurts legibility. Keep strong effects for large headings.
  • Putting two colors in one layer. Each layer has one color. Use two layers instead.
  • Forgetting the dark background. Neon needs contrast. A white halo on a white page does nothing.
  • Expecting a real outline. The outline look fakes a border with offsets. For thick strokes, CSS has -webkit-text-stroke, which this tool does not write.

Frequently asked questions

How do I make a neon text effect?

Stack a small white blur with larger blurs in a bright color, as in the Neon look. Use light text on a dark background, and raise the "Blur" of the outer layers to make the glow wider.

How do I outline text with text-shadow?

Use four layers with offsets of 1px in each diagonal direction and blur 0, as in the Outline look. It is fine for thin borders. For thicker ones, the shadow starts to show gaps at the corners.

Does text-shadow work in all browsers?

Yes. It is supported everywhere and has been for many years. See the MDN page on text-shadow for details.

Can I use the result in a React style?

Yes. Copy the CSS and send it to the CSS to React style converter, which gives you the camelCase object for the style prop.

Is anything uploaded?

No. The generator runs in your browser and nothing you type or paste leaves it.

Report a problem