CSS Gradient Text: How to Create Stunning Colour Effects Online
Gradient text is one of the most visually striking effects you can add to a heading with pure CSS. Done well, it turns an ordinary title into a focal point without a single image or design tool. This guide explains exactly how it works, which CSS properties are involved, and how to generate gradient text instantly in your browser.
What Is CSS Gradient Text?
CSS gradient text is regular text styled so that its fill colour blends smoothly across two or more colours β just like a linear-gradient background, but applied directly to the letters. The effect works entirely in CSS, needs no images, and is supported by all modern browsers.
You have seen it everywhere: product landing pages with purple-to-pink headings, developer portfolios with neon-green-to-cyan titles, SaaS dashboards with branded blue-to-indigo section headers.
How It Works: The Three-Property Trick
CSS does not have a color: gradient(...) shorthand. Instead, gradient text is achieved with three cooperating properties:
background: linear-gradient(90deg, #6366f1, #a855f7);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
Here is what each line does:
background: linear-gradient(...) β sets a gradient as the elementβs background. This is the source of all the colours; without it, nothing works.
-webkit-background-clip: text β clips the background so it only shows through the text glyphs. Everywhere outside the letters is hidden. The standard property background-clip: text also works in modern browsers, but the -webkit- prefix remains widely used for compatibility.
-webkit-text-fill-color: transparent β makes the text fill transparent so the gradient background shows through. Setting color: transparent alone does not work reliably because some browsers render the text colour on top of the background clip.
Gradient Types You Can Use
Any CSS gradient function works as the background source:
linear-gradient β the most common. Colours flow along a straight line at any angle (0Β° = top to bottom, 90Β° = left to right, 135Β° = diagonal).
background: linear-gradient(135deg, #f97316, #ec4899);
radial-gradient β colours radiate outward from a central point. Useful for a glowing centre effect on short words or icons.
background: radial-gradient(circle, #facc15, #f97316);
conic-gradient β colours sweep around a point. Rarely used for text but produces striking rainbow effects on large display headings.
All three work identically with background-clip: text. The choice is purely aesthetic.
Choosing Colour Combinations
Not every gradient looks good as text. A few rules help:
Ensure sufficient contrast. The text must be readable against the page background. Test your combination with a contrast checker β gradients can fool the eye.
Use adjacent hues for smooth transitions. Blue β purple β pink flows naturally because the hues are adjacent on the colour wheel. Blue β orange β green can look jarring.
Limit to two or three stops. Two stops nearly always look cleaner than five. Add a mid-stop only when you need a specific colour to pass through.
Match your brand palette. Pick your primary and secondary brand colours as the two endpoints. The gradient will feel intentional rather than decorative.
Browser Support
background-clip: text is supported in Chrome, Edge, Firefox, Safari, and Opera. The -webkit- prefix is still recommended alongside the unprefixed version for the widest compatibility:
background: linear-gradient(90deg, #6366f1, #a855f7);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent; /* fallback for very old browsers */
Internet Explorer does not support this technique β but IE market share is negligible (below 0.5% globally) and declining every month.
Common Gradient Text Presets
A few combinations that are consistently popular in UI design:
Indigo to Purple β linear-gradient(90deg, #6366f1, #a855f7) β the modern SaaS default; professional and versatile.
Sunrise β linear-gradient(90deg, #f97316, #ec4899) β warm and energetic; works well on dark backgrounds.
Ocean β linear-gradient(90deg, #06b6d4, #6366f1) β cool and calm; popular for tech and developer tools.
Gold β linear-gradient(90deg, #f59e0b, #f97316) β premium feel; use sparingly, best for single words.
Neon β linear-gradient(90deg, #22c55e, #06b6d4) β high-energy; common in gaming and cyberpunk aesthetics.
How to Use a Gradient Text Generator Online
Writing gradient CSS by hand β choosing colours, picking an angle, adding both prefixed and standard properties β takes more time than it should. A visual generator eliminates the guesswork.
The Gradient Text Generator on FreeToolBox lets you design the effect interactively and copy production-ready CSS in one click. Here is how to use it:
- Open the tool at freetoolbox.org/tools/gradient-text-generator.
- Type your text into the preview field β see the effect applied live as you type.
- Choose a colour preset (Indigo Pulse, Sunrise, Ocean, Gold, Neon, Candy, and more) or set your own start and end colours, plus an optional mid-colour stop.
- Pick a direction β use the 8 named presets (Left to Right, Top to Bottom, diagonal corners) or drag the custom angle slider to any degree from 0 to 360.
- Adjust font size and font family to match your projectβs typography.
- Copy the CSS output β the tool generates the full block including both
-webkit-background-clipand the standardbackground-clipproperty, so it works across all modern browsers without any manual edits.
Everything runs entirely in your browser. No files are uploaded, no account is created, nothing is stored.
Try It Now
Design your gradient heading visually β no installs, no sign-up, nothing stored.
Open the free Gradient Text Generator and copy production-ready CSS in seconds.