Boneyard Tools

CSS Gradient Text Generator

Fill headings and text with a color gradient using nothing but CSS. Choose two or more colors and either a linear angle or a radial style, and the tool writes a five-line block that paints the gradient as a background and clips it to the shape of your glyphs. A live preview shows the effect, and one click copies the code.

How to generate CSS gradient text

  1. Set each color with the swatch picker or by typing a hex value, and use + Add color for more stops.
  2. Choose Linear or Radial with the Type buttons.
  3. For a linear gradient, drag the Angle field to aim the color flow in degrees.
  4. Check the live Gradient Text preview to confirm the look.
  5. Copy the CSS block and paste it onto your heading or text element.

Examples

Two-color linear at 90 degrees

colors #ff0080 and #7928ca, linear 90deg
background: linear-gradient(90deg, #ff0080, #7928ca);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;

Three-color linear at 45 degrees

colors #ff0000, #00ff00, #0000ff, linear 45deg
background: linear-gradient(45deg, #ff0000, #00ff00, #0000ff);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;

Radial gradient

colors #ff0080 and #7928ca, radial
background: radial-gradient(circle, #ff0080, #7928ca);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;

Frequently asked questions

How does gradient text actually work?

The element gets a gradient background, then background-clip: text clips that background to the outline of the glyphs. The text fill color is set to transparent, so the clipped gradient shows through the letters instead of a solid color.

Why does the output include -webkit- prefixes?

Clipping a background to text still relies on the -webkit- prefixed properties in several browsers, including Safari. The tool emits both the prefixed and standard versions so the effect works across the widest range of browsers.

Can I use more than two colors?

Yes. Press + Add color to append stops, and they are spread evenly across the gradient in the order listed. You need at least two colors, and the remove button is disabled once you are down to two.

What color formats can I type?

The text field accepts any valid CSS color, such as hex, rgb, hsl, or a named color. The native swatch picker only understands six-digit hex, so a three-digit hex is expanded and anything else falls back to black in the picker while your typed value is still used in the CSS.

What does the angle control do?

For a linear gradient, the angle sets the direction the colors flow, in degrees from 0 to 360. 90deg runs left to right, 0deg runs bottom to top. The angle field is hidden for radial gradients because a radial circle has no single direction.

Should I add a fallback color for accessibility?

Yes. Keep a readable solid color on a parent element or as a fallback so the text stays legible in browsers that do not support background-clip: text, where transparent fill could otherwise render invisible text.

Does this work on any element or only headings?

It works on any text element, including paragraphs, spans, and buttons. Large bold type shows a gradient best because there is more glyph area for the colors to spread across; very thin text can look almost solid.

Is anything uploaded or saved?

No. The CSS is generated in your browser from your color and angle choices, and nothing is ever sent to a server.

Learn more

Related tools