FormatterHQ

CSS Gradient Text Generator

Fill a heading with a two- or three-color linear gradient using background-clip: text. Choose the colors and angle, preview it live and copy CSS with the -webkit- prefixes included.

Loading tool…
Ready.

How to use the CSS Gradient Text Generator

  1. Type your heading into Text.
  2. Pick Colour 1 and Colour 2; keep Add third colour ticked for a three-stop gradient or untick it for two.
  3. Set the gradient Angle, Font size and Weight (Regular, Semibold or Extra bold) and check the preview on the Light and Dark backgrounds.
  4. Copy or download the CSS and HTML tabs, or use Copy CSS + HTML.

Create CSS gradient text with background-clip

This tool generates CSS gradient text: a heading whose letters are filled with a linear gradient instead of a flat color. The technique paints the gradient as the element's background, clips that background to the shape of the glyphs with background-clip: text, and makes the text fill transparent so the gradient shows through.

Example output

The defaults (sky blue, violet and pink at 90°) produce:

.gradient-text {
  background: linear-gradient(90deg, #0ea5e9, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
<h1 class="gradient-text">Gradient text</h1>

Font size and weight are only used for the preview, so the rule does not override your existing heading styles.

Why both prefixed and unprefixed lines?

The unprefixed background-clip: text is now supported in current Chrome, Edge, Firefox and Safari, but Chromium-based browsers only recently added it and older versions, including many embedded WebViews, understand only -webkit-background-clip: text. Keeping both lines covers old and new engines. -webkit-text-fill-color: transparent hides the glyph fill in WebKit and Blink, and color: transparent does the same elsewhere.

Options explained

  • Colour 1, 2 and 3 – stops spread evenly across the gradient. Untick Add third colour for a two-stop gradient.
  • Angle – 90° runs left to right, 180° top to bottom, 135° diagonally.
  • Font size and Weight – heavier weights show more of the gradient; thin strokes can make it barely visible.

Tips and common mistakes

  • The gradient spans the box, not the words. A block-level h1 is as wide as its container, so a short heading shows only the first part of the gradient. Add display: inline-block or width: fit-content to fit the background to the text.
  • Multi-line text. On an inline element that wraps, add box-decoration-break: clone (with the -webkit- prefix for Safari and Chromium) so each line gets the full gradient.
  • Text shadows show through. With a transparent fill, a text-shadow is visible behind the gradient and muddies it. Use filter: drop-shadow() instead.
  • Provide a fallback. In a browser without clipping support the text would be invisible. Wrap the rule in @supports (background-clip: text) or (-webkit-background-clip: text) and keep a solid color outside it.
  • Check contrast of both ends. Every part of the gradient should stay readable on your background; test the lightest stop with the color contrast checker.

For radial, conic or multi-stop gradients with custom positions, design the background in the CSS gradient generator and paste it into the background line. For glow and outline effects on solid text, try the CSS text shadow generator.

Privacy

Your text and colors are processed only in your browser; nothing is uploaded.

Frequently asked questions

Is gradient text accessible to screen readers?
Yes. The text stays real, selectable text in the HTML, so screen readers, search engines and copy-paste all work. The only accessibility concern is visual contrast, which must be checked against every color in the gradient.
Why is my gradient text invisible?
The fill is transparent, so if the background clipping does not apply, nothing is painted. Common causes are a later background shorthand that resets background-clip, or a very old browser. Declare background-clip after the background shorthand.
Can I animate gradient text?
You cannot transition between two gradients directly, but you can make the background larger than the text (for example background-size: 200% auto) and animate background-position. That produces a shimmering or sliding gradient.
Can I apply gradient text to just one word?
Yes. Wrap the word in a <span class="gradient-text">. Because a span is inline, the gradient only covers that word rather than the whole heading.

Last updated September 26, 2026

Related tools

CSS Gradient Generator Create linear, radial and conic CSS gradients visually with draggable colour stops, presets and a live preview, then copy the CSS or Tailwind class. CSS Text Shadow Generator Generate CSS text-shadow effects — soft shadows, hard 3D offsets and neon glows — with live preview on your own text, then copy the CSS. CSS Animation Generator Generate CSS @keyframes animations — fade, slide, zoom, bounce, pulse, shake, spin and more — with duration, delay, easing and loop controls. CSS Background Pattern Generator Generate repeating CSS background patterns — stripes, polka dots, checkerboard, grid, zigzag and more — using only gradients, no images. CSS Border Radius Generator Set border-radius per corner in px or %, or shape organic blobs with the 8-value "fancy" border-radius syntax. Live preview and copyable CSS. CSS Box Shadow Generator Design layered CSS box-shadows with sliders for offset, blur, spread, colour and opacity. Supports inset shadows, presets and a Tailwind class. CSS to LESS Converter Convert CSS to LESS online. Rules sharing a selector are nested automatically. CSS to SASS Converter Convert CSS to SASS online. Rules sharing a selector are nested automatically. CSS to SCSS Converter Convert CSS to SCSS online. Rules sharing a selector are nested automatically. CSS to Stylus Converter Convert CSS to Stylus online. Rules sharing a selector are nested automatically. CSS Toggle Switch Generator Generate an accessible CSS toggle switch built on a real checkbox, with custom size, colours, shape and transition, plus the HTML markup. CSS Transform Generator Generate CSS transform values — translate, rotate, scale, skew and 3D rotateX/rotateY with perspective — and see them applied to a live box.