Skip to main content
GT

Gradient Text Generator

Transform plain text into vibrant gradient typography — choose colours, direction, and preview live with ready-to-use CSS.

Did you like the tool? Thanks!
Share:

More CSS Tools


    

How to Use Gradient Text Generator

Create eye-catching gradient-filled text with a visual builder that handles the complexity of the background-clip:text technique for you. Choose 2 or 3 colour stops, set the gradient direction with an angle slider or one of 8 directional presets (to right, to bottom, to top right, and more), and type your own sample text. Adjust the font size and font weight to see how the gradient reads at different scales. The preview shows exactly how the gradient text will render, and the Copy CSS button provides the complete three-declaration block needed to make gradient text work cross-browser — background gradient, -webkit-background-clip:text, and -webkit-text-fill-color:transparent.

About Gradient Text Generator

Gradient text is one of those CSS techniques that feels like cheating — you take a linear-gradient or radial-gradient, clip it to the shape of text characters, and suddenly your headings glow with a smooth colour transition that would have required an image editor twenty years ago. The technique has become a hallmark of modern SaaS landing pages, conference websites, and digital product marketing because it combines the crisp scalability of real text (selectable, searchable, responsive) with the visual impact of a custom graphic. The CSS behind gradient text is a three-step recipe that many developers learn by copy-pasting from Stack Overflow without understanding why each line is needed. Here is what actually happens: 1. **`background: linear-gradient(to right, #ff0080, #7928ca);`** — This sets the element\'s background to a gradient image. At this point, the gradient fills the entire bounding box of the element, behind the text. The text itself still has its normal solid colour. Nothing looks different yet. 2. **`-webkit-background-clip: text;`** — This is the magic line. The `background-clip` property controls how far a background extends within an element. The default value is `border-box` — the background goes to the outer edge of the border. The `text` value (which is only supported with the `-webkit-` prefix, even in Firefox and non-WebKit browsers) clips the background to the exact shape of the text characters. The gradient is now only visible inside the letter shapes. However, the text still has its own solid colour painted on top of the gradient, so you still see nothing. 3. **`-webkit-text-fill-color: transparent;`** — This makes the text\'s own fill colour transparent, so the background gradient clipped to the text shape becomes visible. The `-webkit-text-fill-color` property overrides the standard `color` property for the text fill specifically, leaving other text-related painting (like text-decoration lines) using the normal `color`. Setting it to `transparent` reveals the gradient underneath. Some developers use `color: transparent` instead, but this also makes text decorations transparent, which may not be desired. The result is selectable, copy-pastable text that renders with a gradient. Screen readers can still read it. Search engines can still index it. It scales to any font size and any screen resolution because it is vector text, not a raster image. This is a genuine CSS superpower, and it is why this tool exists — to let you design the gradient visually without remembering the incantation. This tool supports linear gradients with up to three colour stops (you can set 2 or 3 via the Add/Remove stop buttons). Each colour stop has its own colour picker. The gradient direction can be set either with an angle slider (0-360 degrees) or by clicking one of 8 directional preset buttons: to right (0 deg), to bottom (90 deg), to left (180 deg), to top (270 deg), to top right (45 deg), to bottom right (135 deg), to bottom left (225 deg), to top left (315 deg). The presets are mapped to standard CSS keywords (`to right`, `to bottom`, etc.) which are easier to reason about than angles for common designs. When you use the angle slider, the CSS output uses the `90deg` format; when you use a preset, the output uses the keyword format. Three colour stops are particularly powerful because they enable a highlight effect — a bright colour in the middle sandwiched between two darker colours creates the illusion of a light source moving across the text. For example, #7928ca → #ff0080 → #7928ca (purple → pink → purple) creates a centre glow. Two colour stops produce a simple blend from one colour to another, which is cleaner and often more readable for longer text. The text content input and font size slider work the same as in the Text Shadow Generator: type your own words to see how the gradient interacts with your specific text. Font weight is also adjustable — bold text has thicker glyph strokes and shows more of the gradient, making it appear more saturated, while thin/light text shows less gradient and can appear too subtle. Experimenting with font weight is important because a gradient that looks striking on a 700-weight heading can look washed out on 400-weight body copy. One important limitation to understand: the `-webkit-background-clip: text` technique only works when the background is set directly on the text element, not on an ancestor. That means you cannot apply a gradient background to a parent `<div>` and expect the child `<h1>` to inherit the gradient clipping — the `background` and `-webkit-background-clip` must be on the same element that contains the text. This tool\'s output respects this by producing a single CSS rule targeting the element directly. Fallback behaviour in browsers that do not support the prefixed properties (essentially none in 2026, but for completeness): the text renders in the element\'s normal `color` value. To ensure legibility everywhere, this tool includes a `color` fallback (the first colour stop\'s colour) alongside the gradient declarations. This way, if a browser ignores `-webkit-text-fill-color: transparent`, the text falls back to a solid colour rather than disappearing entirely. This is a best practice that many gradient-text tutorials omit.

Details & Tips

Complete implementation breakdown: **Colour stops (2 or 3):** Two colour stops are shown by default. A "+ Add stop" button adds a third colour stop positioned between the first two. A "- Remove stop" button (shown when 3 stops are active) removes the third. Each stop has a native colour picker. When 2 stops are used, the gradient goes directly from Colour 1 to Colour 2. When 3 stops are used, the gradient goes Colour 1 → Colour 3 → Colour 2, with the third colour positioned at the midpoint (50%). The colour stops are not position-adjustable in this version to keep the interface simple; the third colour always sits in the middle. **Gradient direction — angle mode:** An angle slider (0-360 degrees, step 1) with a paired number input. At 0 degrees, the gradient goes from bottom to top (CSS convention: 0deg = to top). At 90 degrees, it goes left to right. At 180 degrees, top to bottom. At 270 degrees, right to left. The CSS output uses the angle format: `linear-gradient(135deg, ...)`. **Gradient direction — preset mode:** 8 directional buttons in a 3×3 grid (minus the centre). Clicking a preset sets the gradient to that keyword direction. The presets: to right (→), to bottom (↓), to left (←), to top (↑), to top right (↗), to bottom right (↘), to bottom left (↙), to top left (↖). When a preset is active, the CSS output uses the keyword format: `linear-gradient(to right, ...)`. The angle slider and presets are mutually exclusive — clicking a preset disables the angle control, and dragging the angle slider deselects any active preset. **Text content input:** A text input pre-filled with "Gradient Text" or similar sample text. The preview renders this text with the gradient applied. The input accepts any Unicode text. If the input is cleared, the preview shows a default placeholder so the gradient is always visible. **Font size slider:** Range 16px to 96px. The preview text is styled with this font size. Larger sizes show more gradient and make the colour stops more distinct; smaller sizes compress the gradient into a smaller area, potentially losing detail. **Font weight selector:** A dropdown or segmented control with options: Light (300), Normal (400), Medium (500), Semi Bold (600), Bold (700), Extra Bold (800). The default is Bold (700) because gradient text is most commonly used on headings and display text. The weight is applied to the preview in real time. **CSS output generation:** The output is a multi-line CSS block: ```css background: linear-gradient(to right, #ff0080, #7928ca); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: #ff0080; ``` The last two lines are the fallback: `background-clip: text` is the unprefixed version (supported in Firefox 49+ and Chrome 120+), and `color: #ff0080` provides a solid-colour fallback for any environment that does not support background-clip:text at all. **Preview rendering:** The preview element has its style set via Alpine's `:style` binding, concatenating the gradient background, clip properties, font size, and font weight into the element's inline style. The preview text is rendered in a `<div>` or `<p>` tag. **Copy button behaviour:** Clicking Copy CSS copies the full multi-line CSS block to the clipboard. The confirmation changes to "Copied!" for 2 seconds. **Edge cases handled:** - Single colour stop (impossible through UI — minimum 2 enforced): the output would be a solid colour, which defeats the purpose; the Add/Remove buttons prevent this state. - Extremely similar colours (e.g. #ff0000 and #ff0101): the gradient is nearly invisible, but the CSS is valid. The user can see this in the preview. - Very long text: the preview container has a maximum height and scrolls if needed. - Empty text input: the preview shows "Gradient Text" as fallback.

Frequently Asked Questions

How does CSS gradient text work?
It uses three declarations: a gradient as the background, `-webkit-background-clip: text` to clip the background to the text shape, and `-webkit-text-fill-color: transparent` (or `color: transparent`) to make the text fill see-through, revealing the gradient.
Why does gradient text require the -webkit- prefix?
The `background-clip: text` value was originally a WebKit-only feature. While the unprefixed version is now supported in Firefox and modern Chrome, the `-webkit-` prefix remains necessary for broad compatibility, especially with Safari and older Chromium browsers.
Can I use more than 3 colour stops?
CSS linear-gradient supports an unlimited number of colour stops. This tool supports up to 3 for interface simplicity. For more complex gradients, copy the output and add additional colour+position pairs manually in your stylesheet.
What is the best direction for a gradient on text?
Left-to-right (90 degrees or \"to right\") is the most common and reads naturally for left-to-right languages. Top-to-bottom works well for short headings. Diagonal gradients (45 degrees / \"to top right\") create a dynamic, energetic feel. Experiment with the presets to find what suits your design.
Does gradient text work with all fonts?
Yes — gradient text works with any web font, system font, or custom @font-face font because it operates on the rendered glyph shapes. Heavier font weights (bold, extra bold) show the gradient more vividly because they have more surface area.
Is gradient text accessible for screen readers?
Yes — the text remains real DOM text, not an image, so screen readers can read it normally. The gradient only affects the visual appearance. Search engines can also index gradient text normally.
What happens in browsers that do not support background-clip:text?
The text falls back to the solid `color` value (the first colour stop) included in the output. This ensures the text is always readable, even if the gradient effect is not visible. All modern browsers as of 2023 support background-clip:text.
Can I use a radial gradient instead of linear?
CSS radial-gradient works with the background-clip:text technique. This tool generates linear gradients for simplicity, but you can replace `linear-gradient` with `radial-gradient` in the output and the rest of the declarations remain valid.
What is the difference between color:transparent and -webkit-text-fill-color:transparent?
`color: transparent` makes both the text fill and text decorations transparent, which can hide underlines and strikethroughs. `-webkit-text-fill-color: transparent` only makes the fill transparent, leaving text decorations using the `color` property. The tool uses both for maximum compatibility.
Can gradient text be animated?
Yes — you can animate the `background-position` or `background-size` of the gradient to create moving gradient effects on text. The tool gives you the static CSS; animation would be added in your own stylesheet with `@keyframes`.
Is my data sent to a server?
No — the gradient text generator runs entirely in your browser. Nothing you type or design is transmitted anywhere.
Why does the tool include a solid colour fallback?
The `color` fallback ensures the text is always visible — even in environments that do not support the gradient clipping technique, the text shows in the first colour stop's colour rather than disappearing entirely. This is a web development best practice.

Part of These Collections

Also Available As

gradient text generator, css gradient text, background clip text, gradient typography, text gradient css, webkit background clip, css text gradient, gradient font, colorful text css, gradient heading

Found a Problem?

Let us know if something with Gradient Text Generator isn't working as expected.

Thanks — we'll take a look.