ToolNimba

๐ŸŽจ Gradient Text Generator (CSS Background-Clip Text)

Shihab Mia By Shihab Mia ยท Updated 2026-07-18

Color stops
Live preview
Gradient Text

Adjust the colors and angle. The preview and CSS update live.

A gradient text generator turns a plain heading into text painted with a color blend, and it hands you the exact CSS to do it. Pick two colors like #7c3aed and #ec4899, set the angle to 90 degrees, and this tool outputs background-image: linear-gradient(90deg, #7c3aed, #ec4899) with background-clip: text and color: transparent, so your letters fade from purple to pink. Type your own words, tweak the colors and angle, watch the live preview update, then copy the code straight into your stylesheet.

What is the Gradient Text Generator?

This gradient text generator solves a specific CSS limitation: you cannot fill the glyphs of text with a gradient using the color property, because color only accepts a single flat value. The standard technique is to paint the gradient as the element's background-image, clip that background to the outline of the letters with background-clip: text (plus the -webkit-background-clip: text prefix), and then hide the solid font fill so the clipped gradient shows through. This tool always emits that full, correct set of declarations so you never have to remember the order or the prefixes.

The visible blend comes from a CSS linear-gradient, a smooth transition between two or more color stops along a line. The angle sets that line's direction: 0deg runs bottom to top, 90deg runs left to right, and 180deg runs top to bottom, with 45deg and 135deg giving diagonals. Each color stop carries a color and an optional position from 0% to 100%, so you control exactly where one color hands over to the next. Add more stops for rainbow or multi-tone css gradient text across a single word, and swap in radial-gradient or conic-gradient for circular and swept effects that clip to text the same way.

Because the effect depends on clipping, several properties must travel together every time. The background-image (or background shorthand) holds the gradient, both -webkit-background-clip: text and background-clip: text limit it to the letter shapes, and the foreground is knocked out with -webkit-text-fill-color: transparent and color: transparent. Drop the fill-color line and Safari can repaint the solid font color over your gradient; drop the clip and you get a full-width color block behind normal text. Getting every line right by hand is the exact friction a gradient text generator removes.

Browser support for background-clip: text is now broad. The unprefixed property works in Chrome 120+, Edge 120+, Firefox 49+, Safari 15.5+, and Opera 106+, while Safari and older Chromium builds still need the -webkit- prefix, so shipping both is the safe default. For details and the standardization history you can check the MDN reference on <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip" rel="nofollow">background-clip</a> and the long-running <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=759568" rel="nofollow">Firefox implementation bug</a>. For the roughly 1 to 2 percent of visitors on unsupported engines, declare a solid fallback color first (for example color: #7c3aed) before the transparent lines, so those browsers ignore the later fill-color and keep readable text.

Gradient text css shines on large type: hero titles, wordmark logos, pricing highlights, and single accent keywords. It struggles on small body copy, where the blend can drift below the contrast that WCAG requires and become hard to read. Treat this gradient text generator as a headline and branding tool: use it liberally on big display text, keep a solid readable color for paragraphs, and always confirm the lighter end of your gradient still stands out against the page background.

Unlike an image-based approach, gradient text generated with CSS stays real, selectable, searchable text. Screen readers announce it, search engines index it, and it scales crisply on any screen without exporting a PNG. That means you can restyle the gradient later by editing a few lines instead of re-cutting an asset, which is why a css gradient text generator is the maintainable choice for anything that also needs to be accessible and indexable.

When to use it

  • Styling a hero heading or landing-page title with an eye-catching color blend.
  • Building a text-based logo or brand wordmark that uses your brand gradient.
  • Highlighting a single keyword or call-to-action phrase inside a block of text.
  • Adding a rainbow or multi-tone accent to pricing tiers, badges, or section labels.
  • Prototyping color combinations quickly before committing them to a design system.
  • Generating copy-ready CSS gradient text for a component library or design tokens.

How to use the Gradient Text Generator

  1. Pick your first and second colors using the color swatches.
  2. Drag the angle slider to set the gradient direction in degrees.
  3. Type the words you want to preview into the sample text box.
  4. Add more color stops or adjust their positions for multi-color effects.
  5. Copy the generated CSS and paste it onto your text element, keeping both -webkit- and unprefixed lines.

Formula & method

background-image: linear-gradient(angle, color1 pos1%, color2 pos2%, ...); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
Gradient text in 3 steps1. gradientbackground-imageAa2. clip to textbackground-clip: textAa3. hide fillcolor: transparentlinear-gradient(90deg, #7c3aed, #22d3ee, #ec4899)Your Heading

Worked examples

A two-color purple-to-pink gradient running left to right across a heading.

  1. Set color 1 to #7c3aed at 0% and color 2 to #ec4899 at 100%.
  2. Set the angle to 90 degrees so the blend runs left to right.
  3. background-image: linear-gradient(90deg, #7c3aed 0%, #ec4899 100%)
  4. Add -webkit-background-clip: text and background-clip: text.
  5. Set -webkit-text-fill-color: transparent and color: transparent so the gradient shows through the letters.

Result: Heading text fades from purple on the left to pink on the right in every modern browser.

A three-color diagonal gradient with a teal stop in the middle.

  1. Use color stops #7c3aed at 0%, #22d3ee at 50%, and #ec4899 at 100%.
  2. Set the angle to 45 degrees for a diagonal sweep.
  3. background-image: linear-gradient(45deg, #7c3aed 0%, #22d3ee 50%, #ec4899 100%)
  4. Apply -webkit-background-clip: text, background-clip: text, -webkit-text-fill-color: transparent, color: transparent.

Result: Text blends purple to teal to pink along a diagonal line across the heading.

A gradient heading with a safe solid fallback for old browsers.

  1. Declare color: #7c3aed first as the fallback so unsupported engines keep readable text.
  2. Then add background-image: linear-gradient(90deg, #7c3aed 0%, #ec4899 100%).
  3. Add -webkit-background-clip: text and background-clip: text.
  4. Finish with -webkit-text-fill-color: transparent, which supporting browsers apply and old ones ignore.

Result: Modern browsers show the gradient; legacy browsers fall back to solid purple text instead of blank letters.

What each linear-gradient angle does to the blend direction

AngleDirection of the gradient
0degBottom to top
45degBottom-left to top-right (diagonal)
90degLeft to right
135degTop-left to bottom-right (diagonal)
180degTop to bottom

The CSS declarations needed for gradient text

PropertyPurpose
background-imageHolds the linear-gradient (or radial/conic) that supplies the colors.
-webkit-background-clip: textPrefixed clip for Safari and older Chromium browsers.
background-clip: textStandard property that clips the background to the text shape.
-webkit-text-fill-color: transparentKnocks out the font fill in WebKit so the gradient shows.
color: transparentHides the solid font color and doubles as a fallback slot.

Browser support for unprefixed background-clip: text

BrowserSupported fromNeeds -webkit- prefix
Chrome120+Older versions do
Edge120+Older versions do
Safari15.5+Yes, keep the prefix
Firefox49+No
Opera106+Older versions do

Common mistakes to avoid

  • Forgetting transparent fill on the text. If the text keeps its normal color, the solid font paints over the clipped gradient and you never see it. Set -webkit-text-fill-color: transparent and color: transparent so the background gradient shows through the letters.
  • Dropping the -webkit- prefix. Safari and older Chromium builds still rely on -webkit-background-clip: text. Include both the prefixed and unprefixed background-clip so the effect works across Chrome, Safari, Edge, Firefox, and Opera.
  • Using background-color instead of background-image. A gradient is an image, not a color. Setting it with background-color does nothing. Use background-image (or the background shorthand) so the linear-gradient is treated as an image to clip.
  • Shipping no solid fallback. On the small share of browsers that do not support background-clip: text, transparent letters vanish entirely. Declare a solid color first, before the transparent lines, so unsupported engines keep readable text.
  • Using gradient text for body copy. Gradient text can be hard to read at small sizes and may fail WCAG color-contrast checks. Reserve it for large headings or short accents and keep long paragraphs in a solid, accessible color.
  • Setting display: inline on the element. On a plain inline element the background box can be split oddly across line breaks. Use display: inline-block (or a block heading) so the gradient maps cleanly onto the text.

Glossary

Gradient text
Plain, selectable text painted with a color gradient by clipping a background image to the letter shapes.
Linear gradient
A smooth transition between two or more colors along a straight line set by an angle.
Color stop
A single color plus its position (0% to 100%) along the gradient line.
background-clip: text
A CSS property that clips an element background so it is only painted inside the text shape.
-webkit-text-fill-color
A WebKit property that sets the fill color of text; set to transparent to reveal the clipped gradient.
Angle
The direction of a linear gradient in degrees, where 90 degrees runs left to right.
Vendor prefix
A browser-specific property name such as -webkit- used while a feature is being standardized or for legacy support.
Fallback color
A solid color declared first so browsers without background-clip: text still show readable text.

Frequently asked questions

How do I make gradient text in CSS?

Set a linear-gradient as the element background-image, add -webkit-background-clip: text and background-clip: text, then set -webkit-text-fill-color: transparent and color: transparent. The gradient is clipped to the letters so the text shows the blend. This gradient text generator outputs every line ready to copy.

Why is my gradient text invisible?

The usual cause is a missing piece of the set: you need the gradient as background-image, both background-clip and -webkit-background-clip set to text, and the text fill made transparent. If any one is missing you get a solid color, a full-width block, or blank letters.

Do I still need the -webkit- prefix?

Yes. Safari and older Chromium browsers still implement the feature through -webkit-background-clip: text. Adding both the prefixed and unprefixed properties gives the widest compatibility across Chrome, Safari, Edge, Firefox, and Opera.

Can I use more than two colors?

Yes. Add extra color stops and set each position from 0% to 100%. Multiple stops let you build rainbow or multi-tone css gradient text that blends across a single heading or word.

What does the angle value control?

The angle sets the direction of the linear gradient. 0 degrees runs bottom to top, 90 degrees runs left to right, 180 degrees runs top to bottom, and 45 or 135 degrees give diagonal blends. Drag the slider to see the preview change.

How do I add a fallback for old browsers?

Declare a solid color first, such as color: #7c3aed, before the transparent lines. Browsers that support background-clip: text apply the later transparent fill and show the gradient, while unsupported browsers ignore it and keep the solid color.

Is gradient text bad for accessibility or SEO?

The text itself stays real, selectable, and indexable, so SEO and screen readers are fine. The risk is contrast: gradient text can dip below WCAG thresholds at small sizes, so reserve it for large headings and keep the lighter end readable against your background.

Can I animate gradient text?

Yes. Make the background-size larger than the text (for example 200%) and animate background-position with a CSS keyframe loop. The clipped gradient then appears to shift across the letters while the text stays fully readable.

Does gradient text work in email?

Not reliably. Many email clients strip background-clip: text, so gradient text often falls back to a solid or default color. For email, bake the gradient into an image with alt text instead of relying on CSS.

Can I use a radial or conic gradient on text?

Yes. Swap linear-gradient for radial-gradient or conic-gradient in the background-image; the same background-clip: text and transparent fill still apply. This gives circular glow or swept color effects clipped to the letters.