Skip to main content
7B BusyBoss

CSS Gradient Text Generator: Copy CSS, HTML & Tailwind

Make gradient text with 2 or 3 colors, linear or radial, with a live preview. Copy CSS with -webkit- prefixes, an inline HTML snippet or Tailwind classes.

No limitsZero data leaksSuper fast
90°
56px
Gradient text
background: linear-gradient(90deg, #3b82f6, #ec4899);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
color: transparent;

Don't take our word for it — turn your wi-fi off.

This tool keeps working with no connection at all, because your file is processed here in the browser. A site that uploads your file cannot do that. Disconnect and try it — this box will notice.

Prefer to check properly? Open DevTools → Network, then run the tool. Your file appears in no request. Why none of our tools upload

You're on 7BusyBoss — 300+ free tools that run instantly in your browser. No signup, nothing uploaded.

Browse all Design Generators →
About this tool

A CSS gradient text generator comes down to five declarations: background: linear-gradient(90deg, #3b82f6, #ec4899); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; The gradient is painted as the element's background, clipped to the letter shapes, and the solid text color is made transparent so the gradient shows through. The generator above writes that block for you as CSS, inline HTML or Tailwind classes.

Why each line of the gradient text CSS is needed

Drop any one of the five and something breaks.

DeclarationWhat it doesWithout it
background: linear-gradient(...)Paints the gradient across the element's boxNothing to show through, so the text disappears
-webkit-background-clip: textClips the background to the glyphs in Safari and older ChromiumThose browsers show a gradient rectangle with invisible text
background-clip: textThe standard property, used by Firefox and current ChromiumYou rely on the prefix alone
-webkit-text-fill-color: transparentBlink and WebKit paint glyphs with this instead of color when it is setA fill color inherited from a reset or component library paints solid letters over the gradient
color: transparentThe standard way to hide the solid text colorSolid text sits on top of the gradient

Order matters too. The background shorthand resets background-clip, so it has to come before the clip lines. Put it after them and the gradient fills the whole box again.

Multi-color and radial gradient text

A third color is one more stop. linear-gradient(90deg, #f59e0b, #ef4444, #ec4899) is the Sunset preset. Stops without positions are spread evenly, so three colors land at 0%, 50% and 100%. Write #ef4444 30% to move the middle one.

The radial version swaps the function. radial-gradient(circle, #22d3ee, #3b82f6, #6366f1) puts the first color at the center of the element and the last at the edge. The circle is sized to reach the farthest corner, so on a long line of text the center color is a small patch in the middle.

HTML gradient text with an inline style

When there is no stylesheet to edit, in a CMS block for instance, put the same declarations in a style attribute:

<h1 style="display: inline-block; background: linear-gradient(90deg, #3b82f6, #ec4899); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;">Your text</h1>

Do not drop the display: inline-block. An h1 is a block element as wide as its container, and the gradient spans that whole width. A heading 300 px wide in a 1200 px container shows only the first 25% of the gradient, so blue-to-pink comes out almost entirely blue. inline-block (or width: fit-content) shrinks the box to the text.

Tailwind gradient text

In Tailwind it is bg-gradient-to-r from-[#3b82f6] to-[#ec4899] bg-clip-text text-transparent, plus via-[#hex] for a middle color. Tailwind has eight directions, so a CSS angle gets rounded to the nearest one:

Tailwind classEquivalent CSSAngles that round to it
bg-gradient-to-tto top (0°)0–22° and 338–360°
bg-gradient-to-trto top right23–67°
bg-gradient-to-rto right (90°)68–112°
bg-gradient-to-brto bottom right113–157°
bg-gradient-to-bto bottom (180°)158–202°
bg-gradient-to-blto bottom left203–247°
bg-gradient-to-lto left (270°)248–292°
bg-gradient-to-tlto top left293–337°

The four side directions are exact. The corner ones point at the element's corner, so to top right equals 45° only on a square box. A 100° gradient becomes bg-gradient-to-r, 10° off. For the exact angle, use an arbitrary value, which works in Tailwind v3 and v4: bg-[linear-gradient(100deg,#3b82f6,#ec4899)] bg-clip-text text-transparent. In v4, bg-gradient-to-r still works as an alias of bg-linear-to-r, but v4 blends in OKLab, so mid-tones can look a little different from the plain CSS.

Animated gradient text

The generator outputs static CSS. To animate it, make the background wider than the text and slide it:

.gradient-text { background: linear-gradient(90deg, #3b82f6, #ec4899, #3b82f6); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: gradient-pan 4s linear infinite; }

@keyframes gradient-pan { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }

The gradient starts and ends on the same color, so the tile repeats without a seam, and a 200% move shifts it by exactly one tile. background-size has to follow the background shorthand, for the same reason as the clip. Wrap the animation in @media (prefers-reduced-motion: no-preference) so people who turn off motion get a still gradient.

Contrast, shadows and selection highlights

  • Contrast. Check every stop against the background, because the weakest one sets the limit. On white, the default blue #3b82f6 is 3.68:1 and the pink #ec4899 is 3.53:1. Both pass the 3:1 WCAG minimum for large text (24 px, or about 18.7 px bold) and both fail the 4.5:1 that body text needs. The same pair on a dark #111827 background scores 4.82:1 and 5.03:1. The Neon preset's lime #a3e635 manages only 1.51:1 on white, so keep that one for dark backgrounds.
  • Shadows. text-shadow paints on top of the clipped background, so it shows through the transparent letters and muddies the gradient. Use filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4)) on the element instead. For a solid-color heading, the text shadow generator builds the shadow for you.
  • Selection. Select gradient text and you can get an empty highlight, because the letters are still transparent. Give the selection a solid fill: .gradient-text::selection { background: #1e3a8a; -webkit-text-fill-color: #fff; color: #fff; }.

Browser support

Every current version of Chrome, Edge, Firefox, Safari and Opera renders gradient text. Chromium only accepted the unprefixed background-clip: text from Chrome 120 in late 2023, so older Chromium builds lean on the -webkit- line. For a solid fallback in old browsers, set a normal color first and apply the transparent declarations inside @supports ((-webkit-background-clip: text) or (background-clip: text)).

How to use this generator

  1. Type your text, then pick a preset (Blue → pink, Sunset, Ocean, Neon, Fire, Mint) or set Color 1 and Color 2.
  2. Tick Middle to add a third stop. Swap reverses Color 1 and Color 2.
  3. Choose Linear and set an angle from 0° to 360°, or Radial for a circle with Color 1 at the center.
  4. Copy from the CSS, HTML or Tailwind tab. The HTML tab includes the font size from the slider. The Tailwind tab tells you when your angle was rounded and adds an exact arbitrary-value version.

Common mistakes

  • Gradient text on paragraphs. It is a headline effect. Long runs of text in two low-contrast colors are hard to read.
  • Inline text that wraps. By default the second line continues the gradient where the first ended. Add -webkit-box-decoration-break: clone; box-decoration-break: clone; and each line gets the full gradient.

For gradient backgrounds rather than text, the CSS gradient generator handles full linear and radial backgrounds. If the heading is going on a video thumbnail, the aspect ratio calculator gives you 16:9 sizes such as 1280 × 720.

How to use the Gradient Text Generator

Takes about a minute. No signup, no download, your data stays in your browser.

  1. 1
    Open the tool. Scroll up to the Gradient Text Generator above — it loads instantly in your browser, no install needed.
  2. 2
    Enter your values. The fields come pre-filled with realistic defaults so you can see how it works — replace them with your own numbers.
  3. 3
    Read the result. The output updates instantly. Copy or share it — nothing is uploaded to a server, everything stays on your device.

Frequently asked questions

Common questions about the Gradient Text Generator.

How do I make gradient text in CSS?

Give the element a gradient background, clip it to the text and make the text transparent: background: linear-gradient(90deg, #3b82f6, #ec4899); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent. Keep the background line first, because the background shorthand resets background-clip.

How do I make gradient text in HTML?

Put the same CSS in a style attribute, for example <h1 style="display: inline-block; background: linear-gradient(90deg, #3b82f6, #ec4899); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;">Your text</h1>. The HTML tab of this generator builds that snippet with your colors and font size. display: inline-block keeps the gradient as wide as the text rather than the whole container.

How do I make gradient text in Tailwind CSS?

Use bg-gradient-to-r from-[#3b82f6] to-[#ec4899] bg-clip-text text-transparent, and add via-[#hex] for a middle color. Tailwind has eight directions, so an angle such as 100° is rounded to bg-gradient-to-r (90°). For the exact angle, use the arbitrary value bg-[linear-gradient(100deg,#3b82f6,#ec4899)] with the same bg-clip-text text-transparent classes.

Can gradient text have three or more colors?

Yes. Each extra color is another stop, as in linear-gradient(90deg, #f59e0b, #ef4444, #ec4899), and unpositioned stops are spaced evenly at 0%, 50% and 100%. This generator does three stops through the Middle option. For four or more, add stops to the copied CSS by hand.

Does radial gradient text work?

Yes. Replace linear-gradient with radial-gradient(circle, ...) and keep the clip and transparent lines. The generator's Radial mode does this for you. The first color sits at the center of the element, so radial gradients look best on short, large words rather than long lines.

Why does my gradient text show a rectangle or disappear?

A colored rectangle means the background is not clipped: background-clip is missing, or the background shorthand comes after it and resets it. Invisible text means the text is transparent but the clip did not apply, which happens in some email clients and in old browsers.

Is gradient text accessible?

It is real text, so screen readers read it, but each color still has to contrast with the background. The default blue #3b82f6 and pink #ec4899 score 3.68:1 and 3.53:1 on white, enough for large text (3:1) but short of what body text needs (4.5:1). On a dark #111827 background the same pair scores 4.82:1 and 5.03:1.

Can I animate gradient text with CSS?

Yes. Use a gradient that starts and ends on the same color, set background-size: 200% auto, and animate background-position from 0% 50% to 200% 50% with @keyframes. The generator outputs static CSS, so add the animation yourself and switch it off under prefers-reduced-motion.

Community rating

Discussion (0)

No comments yet. Start the discussion.