Free CSS Text Gradient Generator
Create beautiful gradient text effects. Adjust colours, angle and preview text, then copy the CSS.
How It Works
- Choose your colors: select two or more colors for the gradient using the color pickers.
- Set the angle and style: choose linear or radial gradient, adjust the angle, and optionally add a color stop position.
- Copy the CSS: the generated CSS code uses background-clip: text and -webkit-background-clip: text for the gradient text effect, copy it directly into your stylesheet.
Why Use CSS Text Gradient Generator?
Gradient text is one of the most popular modern CSS effects for headings, logos, and call-to-action text. Achieving it requires a specific combination of CSS properties (background, background-clip, -webkit-text-fill-color) that is easy to get wrong. This generator handles the cross-browser syntax automatically and gives you a live preview so you can perfect your gradient before writing a single line of code.
Features
- Multi-color stops: add as many color stops as you need for complex gradient effects.
- Linear and radial: choose between directional linear gradients and centered radial gradients.
- Angle control: set the gradient angle from 0° to 360° with a visual dial.
- Live preview: see your gradient text update in real time with your chosen sample text.
- Cross-browser CSS: output includes -webkit prefixes and fallbacks for maximum compatibility.
Frequently Asked Questions
How does CSS gradient text work?
CSS gradient text works by applying a gradient as the element's background, then clipping the background to the text shape using background-clip: text and making the text color transparent with -webkit-text-fill-color: transparent (or color: transparent). Only the text-shaped cutout of the gradient is visible.
Does gradient text work in all browsers?
CSS gradient text works in all modern browsers including Chrome, Firefox, Safari, and Edge. The -webkit-background-clip: text property is well-supported. Always provide a solid color fallback for very old browsers using the color property.
Can I use this on any font size?
Yes. Gradient text scales perfectly with font size, it is pure CSS, not an image, so it remains crisp at any resolution including high-DPI displays.
A Short History of Gradient Text on the Web
Gradient text became visually possible on the web with WebKit's -webkit-background-clip: text property, an experimental Safari/Chromium extension proposed by the WebKit team in 2008 as a way to fill the glyph shapes of text with an arbitrary background (gradient, image, anything). The technique stayed unofficial for years: Firefox shipped unprefixed background-clip: text only in version 49 (September 2016), and the CSS Backgrounds Module Level 4 formalised it as a W3C working draft starting around 2018. The underlying gradient syntax matured separately. The CSS Images Module Level 3 (W3C Recommendation 2017) standardised linear-gradient() and radial-gradient() as first-class image values; conic-gradient() followed in Module Level 4 (Chrome 69 September 2018, Safari 12.1 March 2019, Firefox 83 November 2020). The combination of those two specs is what makes a one-line gradient heading possible today. Adoption exploded in the developer community when Tailwind CSS shipped its bg-clip-text utility classes in v1.4 (2020), making gradient headings a drop-in primitive. Modern brand identity now relies on gradient text as a visual signature: Stripe's «Bridges» hero, Linear's gradient logotype, Vercel's landing page, Apple's WWDC marketing, and Notion's template store all use the technique. The combined background-clip: text + gradient pattern has effectively replaced the «PNG of a stylised heading» that dominated 2005-2015 web design, removing a category of accessibility and performance problems in one move.
The Anatomy of CSS Gradient Text
- The gradient itself.
background-image: linear-gradient(90deg, #f00, #00f)sets the element's background to a 90-degree gradient running from red to blue. The gradient can be linear (directional), radial (centred), conic (rotational sweep), or any of the repeating variants. CSS gradients are image values, not colour values, which is what makes them clippable to a text shape. - background-clip: text. Tells the browser to render the background only inside the geometry of the rendered glyphs. Without this single property, the gradient fills the whole element box; with it, the gradient is restricted to the text outline. Originally a WebKit extension prefixed as
-webkit-background-clip: text, now also unprefixed in Firefox 49+ (2016) and Chromium-based browsers. - color: transparent or -webkit-text-fill-color: transparent. Once the background is clipped to the text, the visible result still depends on what colour the text itself paints over the background. Setting
color: transparent(or the prefixed-webkit-text-fill-color: transparent) lets the gradient show through. Without this, the solid text colour would simply paint over the clipped gradient. - The
-webkit-prefix chain. Safari, the platform with the most accumulated prefix history, still parses the unprefixed properties but the prefixed versions remain in production code for legacy reasons. Output from this generator includes bothbackground-clip: textand-webkit-background-clip: textso the technique works back to Safari 14 and any legacy WebKit-based browsers. - Gradient types and stops.
linear-gradient(angle, color1, color2, ...)goes in a direction;radial-gradient(shape at position, ...)emanates from a point;conic-gradient(from angle at position, ...)sweeps around like a clock hand. Each accepts arbitrarily many colour stops, with explicit positions (red 0%, blue 50%, green 100%) for fine control over where each colour begins and ends.
Real-world Gradient Text Patterns
- Brand identity headlines. Stripe's «Bridges» series, Linear's product hero, Vercel's «Develop. Preview. Ship.» banner all use gradient text as a brand signature. Single-colour wordmarks feel dated for early-stage SaaS, while gradient headings carry the «built in 2024» visual cue.
- Hero section headings. The H1 on a landing page is often the single text element with the highest design budget. Gradient text gives it visual weight without resorting to a custom font file, an SVG, or a hero image, all of which add page weight and accessibility concerns.
- Big-number metric pages. Pricing pages («$0 to start»), stat callouts («10× faster»), and dashboard summaries use gradient text to draw the eye to the number itself. The gradient effectively replaces the «coloured circle behind the number» pattern from older designs.
- Call-to-action buttons. A subtle gradient on the CTA text (rather than the button background) feels more refined than a solid colour and pairs well with a glassmorphism or neumorphic button surface. The technique is common in fintech and design-tool brands.
- Navigation highlights. An active or hover state on a nav link can use gradient text to provide visual feedback without adding an underline or background colour change. This pattern is heavily used in documentation sites (Stripe Docs, Tailwind Docs).
- Dark mode and brand-bridge designs. Gradient text works particularly well on dark backgrounds because the saturated colours pop without competing against a busy light surface. Many products keep solid-colour headlines on light mode and switch to gradient on dark mode (using a CSS variable swap).
- E-commerce product callouts. «Sale», «New», «Limited Edition» badges and product subtitles use gradient text to differentiate themselves from the body copy without requiring icon assets. Shopify's storefront editor surfaces gradient text as a built-in option in 2024.
Accessibility Considerations
- WCAG 2.1 SC 1.4.3 Contrast (Minimum). The success criterion requires at least 4.5:1 contrast between text and background for normal text (3:1 for large text, defined as 18pt+ or 14pt bold). Gradient text is harder to evaluate because the contrast ratio varies across the gradient. The safe approach: ensure the lightest colour in your gradient still meets the ratio against the background. Tools like WebAIM Contrast Checker and Stark in Figma can help.
- Choose the darkest gradient colour first. When pairing a gradient with a light background, picking the gradient's lightest colour to clear the 4.5:1 ratio guarantees the rest of the gradient is also accessible. The same applies in reverse on dark backgrounds. WCAG 2.2 (recommendation October 2023) tightened guidance on visual presentation, including the case where text contrast varies across the run.
- Screen readers see the text unchanged. Because the gradient is purely a visual styling (
background-clip,color), assistive technology reads the rendered text content regardless of how it's coloured. There's no «alt text» concern with gradient text, unlike rasterised image-text or SVG-text-without-a-text-element. - prefers-reduced-motion. Animated gradients (background-position transitions, colour-cycle animations) should be wrapped in
@media (prefers-reduced-motion: no-preference)so users with vestibular disorders or motion sensitivity see a static gradient. The CSS Working Group added the media query in 2017; browser support has been universal since 2020. - Browser zoom and resize text. WCAG 2.1 SC 1.4.4 requires text to be resizable up to 200% without loss of content. Gradient text scales perfectly because it's purely CSS-rendered (no rasterisation). Users with low vision who use Ctrl+/Cmd+ zoom will see the gradient remain crisp at any zoom level.
- Print stylesheets. Most browsers drop background-clipped colours on print because the printed page expects ink-on-paper, and the gradient backgrounds disappear. Always provide a
@media printoverride that sets a solidcoloron the gradient text so printed copies remain readable. Many designers forget this; printing a gradient heading often produces invisible text. - Fallback colour chain. Always set a solid
colorproperty first, then addcolor: transparent(or-webkit-text-fill-color: transparent) so that browsers withoutbackground-clip: textsupport (legacy IE, very old Android browsers) still see solid-colour text rather than invisible text. The generator's output includes this fallback by default.
More frequently asked questions
Why is gradient text considered a modern brand signature?
Two reasons. First, the technical reason: gradient text became fully cross-browser only around 2017-2020, so designs that use it visibly carry the «built recently» visual cue, the same way that flat design said «2013» or skeuomorphism said «2010». Second, the cultural reason: Stripe, Linear, Vercel, and Apple WWDC popularised gradient text as a brand identity element in the 2020-2024 wave of fintech and developer-tool marketing. Adopting the same visual language signals belonging to that design lineage.
How do I animate a gradient text effect?
The most common technique animates background-position on an oversized gradient. Set background-size: 200% 200% and animate background-position from 0% 0% to 100% 100% on a 3-5 second loop. Always wrap the keyframes in @media (prefers-reduced-motion: no-preference) so users with motion sensitivity see the static version. Avoid animating individual colour-stops directly: CSS does not currently interpolate between gradient values smoothly across browsers, although CSS @property (W3C Candidate Recommendation 2022) is starting to enable this.
Can search engines and screen readers see gradient text?
Yes. Gradient text is pure HTML text styled with CSS; the DOM still contains the actual characters. Google, Bing, screen readers (NVDA, JAWS, VoiceOver), and any text-extraction tool reads the content exactly as if it were plain solid-coloured text. This is one of the main reasons gradient CSS text replaced the old «PNG of a stylised heading» pattern: those images were invisible to search and screen readers without manual alt text.
Does gradient text work in HTML emails?
Mostly no. Outlook desktop (Word rendering engine) strips background-clip; Gmail's web client supports it inconsistently; Apple Mail and modern Gmail mobile clients usually render it correctly. For email campaigns, the safer approach is to ship a fallback solid-colour heading and treat gradient text as «progressive enhancement» for clients that support it. Some teams precompose the heading as a PNG/SVG with alt text and accept the accessibility tradeoff.
What colours work best together in a text gradient?
Three patterns dominate. Analogous (colours next to each other on the wheel, e.g. blue → purple → pink) gives smooth, brand-friendly results and is the default for most modern design systems. Complementary (opposite on the wheel, e.g. blue → orange) creates strong contrast but can look gaudy in long text. Brand-tinted (your primary brand colour with subtle lightness/saturation variation) produces a sophisticated effect that feels integrated rather than decorative. Avoid mixing more than three colours in a single headline; complex gradients are best reserved for icons and graphic elements.