Home/Tools/Colors/Gradient Text Generator
Colors · Generator

Gradient Text Generator

Generate stunning gradient text effects using background-clip and text-fill techniques.

Gradient Text Settings

32px
600
45deg

Preview

Gradient Text

Generated CSS, HTML & Tailwind
.gradient-text {
  font-size: 32px;
  font-weight: 600;
  background: linear-gradient(45deg, #6366f1, #8b5cf6);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  display: inline-block;
}
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the CSS Gradient Text Generator?

Generate gradient-filled text using background-clip: text. Set your colours, direction, and font size, then copy the ready-to-use CSS.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the CSS Gradient Text Generator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Set your gradient colours

Pick the start and end colours using the colour pickers. Adjust angle and add extra stops as needed.

2

Preview your text

Type sample text in the preview field. Adjust font size and weight to see how the gradient looks at your target size.

3

Copy the CSS

Click Copy CSS to grab the full ruleset including background-clip and color: transparent. Paste onto any heading element.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
.gradient-heading {
  background: linear-gradient(90deg, #6C2EF5 0%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block; /* required for background to size correctly */
}

The display: inline-block is required - without it, the background stretches to the full container width and the gradient looks wrong on short text.

Pro tips

Pro tips for better results

Always include display: inline-block

Without inline-block (or inline-flex), the background fills the full block width. For short headings, the gradient shifts to the wrong position.

Use on large text only

Gradient text below 18px loses legibility. Reserve this technique for display headings, hero text, and logos - not body copy or labels.

Check browser support for background-clip: text

Supported in Chrome 4+, Firefox 3.6+, Safari 3+, and Edge 12+. The -webkit- prefix is still required for Safari on older iOS devices.

Avoid gradient text on dark backgrounds with low contrast

Gradient text can become unreadable when the lightest stop of the gradient blends into a dark background. Always check contrast at both ends of the gradient.

FAQ

Frequently asked questions

The background-clip: text property requires the -webkit- prefix in older Safari (pre-15.4) and some WebKit-based browsers. This generator outputs both -webkit-background-clip and background-clip to cover all cases.
Yes, but it requires the same technique. Add background: gradient, -webkit-background-clip: text, background-clip: text, and color: transparent to the button. Remove the button background or set it separately on a pseudo-element.
Gradient text can fail WCAG contrast requirements because contrast ratio is measured against the lowest-contrast colour in the gradient. Use a contrast checker on both the lightest and darkest stops against your background.
No. Everything runs in your browser. Nothing is sent to a server.

From the blog

Read more