CSS Gradient Text Generator
Create beautiful gradient text effects using linear, radial, and conic gradients. Live preview with adjustable colors and angle.
What is CSS Gradient Text?
CSS gradient text is text whose glyphs are filled with a color gradient instead of a single solid color. The technique paints a gradient as the background of the text element and then clips that background to the shape of the letters. Because the background only shows through the glyphs, the result looks like the text itself was painted with a gradient.
The effect is built from a small set of cooperating properties. background holds the gradient, background-clip: text (plus the -webkit- prefixed version for Safari) restricts the paint to the text, and -webkit-text-fill-color: transparent makes the text itself see-through so the gradient is visible. A solid color is included as a fallback for browsers that do not support clipping.
This generator supports three gradient shapes. A linear-gradient runs along an angle you choose, a radial-gradient spreads outward in a circle, and a conic-gradient sweeps around a center point starting from a chosen angle. The angle slider only affects linear and conic gradients, since a radial gradient is defined purely by its circular shape.
Everything runs client-side. You can type your own preview text, pick two colors with the color pickers or type hex values directly, and the CSS output updates instantly. The tool ships a ready-made .gradient-text class, so you can copy it into a stylesheet and reuse it wherever you need the effect.
Key Concepts
- background-clip: text — clips the gradient background to the shape of the glyphs.
- -webkit-text-fill-color: transparent — exposes the gradient by making the fill transparent.
- Linear gradient — a directional blend along an angle from 0 to 360 degrees.
- Radial gradient — a circular blend that spreads outward from the center.
- Conic gradient — a blend that sweeps around the element from a starting angle.
- Solid color fallback — a plain
colorvalue keeps the text readable in older browsers.
How to Use
- Load a preset or start fresh — Choose one of the six presets from the dropdown, or leave it empty to build from the current colors.
- Choose the gradient type — Select Linear, Radial, or Conic to control how the colors blend.
- Pick the two colors — Use the color pickers or type hex values into the Color 1 and Color 2 fields.
- Adjust the angle and text — Drag the angle slider for linear and conic gradients and edit the preview text.
- Copy the CSS class — Click Copy CSS and paste the generated
.gradient-textrule into your stylesheet.
Preset and Property Reference
| Preset | Color 1 | Color 2 | Angle | Type |
|---|---|---|---|---|
| Ocean Blue | #3b82f6 | #06b6d4 | 45 | Linear |
| Sunset | #f97316 | #e11d48 | 135 | Linear |
| Neon | #22c55e | #a855f7 | 90 | Linear |
| Gold | #f59e0b | #b45309 | 180 | Linear |
| Rainbow | #ef4444 | #8b5cf6 | 0 | Conic |
| Purple Haze | #7c3aed | #ec4899 | 45 | Linear |
| Property | Typical value | Purpose |
|---|---|---|
| background | linear-gradient(45deg, ...) | Paints the gradient behind the text. |
| background-clip | text | Clips the background to the glyphs. |
| -webkit-background-clip | text | Safari and WebKit support. |
| -webkit-text-fill-color | transparent | Reveals the gradient through the text. |
| color | Color 1 | Fallback color for unsupported browsers. |
Worked Examples
- Default linear — the starting values produce
linear-gradient(45deg, #3b82f6, #8b5cf6). - Ocean Blue preset — outputs
linear-gradient(45deg, #3b82f6, #06b6d4). - Sunset preset — outputs
linear-gradient(135deg, #f97316, #e11d48). - Radial type — ignores the angle and outputs
radial-gradient(circle, #3b82f6, #8b5cf6). - Rainbow preset — uses conic and outputs
conic-gradient(from 0deg, #ef4444, #8b5cf6). - Custom hex colors — entering
#ff0000and#0000ffat 90 degrees yieldslinear-gradient(90deg, #ff0000, #0000ff).
Tips and Common Mistakes
- Append the leading hash — hex inputs are validated as full six-digit values, so type
#e11d48with the hash. - The angle does nothing for radial gradients — the slider is hidden for radial because a circle has no direction.
- Keep the webkit prefix — do not delete the
-webkit-lines or Safari will show solid text. - Always ship the fallback color — the
colorline keeps text readable if clipping is unsupported. - Choose a contrasting pair — very close colors look muddy when clipped to thin glyphs.
- Copy the whole class — paste the entire
.gradient-textrule rather than a single property to avoid a broken effect.
Common Use Cases
Gradient text is a quick way to add visual interest without images. These are the situations where it is used most often.
- Hero headings — make a landing-page headline stand out with a bold two-color fill.
- Logo wordmarks — give a text logo a signature gradient that matches the brand palette.
- Call-to-action labels — draw the eye to buttons and links with a subtle gradient.
- Section titles — separate major content blocks with colored headings.
- Pricing highlights — emphasize a featured plan name or price.
- Social graphics — reuse the exported class in HTML templates for share images.
Frequently Asked Questions
Does this work in all browsers?
Yes, background-clip: text is supported in all modern browsers. The CSS includes a solid fallback color for older browsers.
Can I use more than two colors?
Yes, you can add additional color stops to the gradient declaration in the generated CSS. The tool generates a two-color gradient as a starting point.
What gradient types are supported?
Three types are supported: linear-gradient with an angle, radial-gradient in a circle, and conic-gradient sweeping from a starting angle.
Why is the angle slider hidden for radial gradients?
A radial gradient spreads outward in a circle, so it has no direction. The angle control only applies to linear and conic gradients.
Can I change the preview text?
Yes. Type in the Preview Text field and the example text updates instantly so you can try the effect on your own wording.
How do presets work?
Choosing a preset fills in both colors, the angle, and the gradient type at once. There are six presets: Ocean Blue, Sunset, Neon, Gold, Rainbow, and Purple Haze.
Do I need to add the -webkit- prefixes?
Yes. The generated CSS includes -webkit-background-clip and -webkit-text-fill-color so the effect works in Safari and other WebKit browsers.
Does the tool send my text or colors anywhere?
No. Everything is processed locally in your browser and the generated CSS is produced client-side. No text, colors, or settings leave your device.