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
- Set each color with the swatch picker or by typing a hex value, and use + Add color for more stops.
- Choose Linear or Radial with the Type buttons.
- For a linear gradient, drag the Angle field to aim the color flow in degrees.
- Check the live Gradient Text preview to confirm the look.
- 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
- How background-clip text paints gradient type
The five CSS lines behind gradient text, why the webkit prefix persists, and how to keep the effect accessible and cross-browser.
Related tools
CSS Gradient Generator
Build linear and radial CSS gradients with a live preview. Pick colors, set the angle and copy ready-to-paste background code for your site.
Color Palette Generator
Generate complementary, analogous, triadic, tetradic and monochromatic color palettes from one base color. Pick a hex, copy each shade as hex, RGB or HSL.
Box Shadow Generator
Build CSS box-shadow visually. Drag sliders for offset, blur, spread, color and opacity, see a live preview, and copy the box-shadow code.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.