
CSS Gradient Generator
Pick linear, radial or conic, set the colours, and this free generator writes the CSS as you go. Copy it as a background, as gradient text that clips the colours to your letters, or as a Tailwind class. Every stop has its own opacity, so fades to transparent and hard-edged stripes take one click.
background: linear-gradient(90deg, #7c3aed 0%, #f25f3a 100%);
Paste into any stylesheet as a background.
How do you make gradient text in CSS?
Paint the gradient as the element's background, clip that background to the letters, and make the text itself transparent so the colours show through. Pick Gradient text above and the tool writes the four lines for you:
background: linear-gradient(90deg, #7c3aed 0%, #f25f3a 100%);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
It works in about 97% of browsers in use today; the prefixed line covers older Safari and Chrome. When it goes wrong, it is almost always one of three things:
- The text shows as a solid colour. A later rule sets
coloragain, so the text is no longer transparent and covers the gradient. Look for it in your inspector. - Only one slice of the gradient shows. The gradient spans the whole element, so a short word inside a full-width heading gets a single colour. Add
display: inline-blockso the box hugs the text. - The text is invisible. If the clip is not applied, transparent text on a plain background reads as nothing. Keep gradient text for headings, and check that the palest stop still contrasts with the page.
In Tailwind, use the Tailwind output and add bg-clip-text text-transparent to the same element.
Linear, radial or conic: which one do you need?
- Linear blends along a straight line at the angle you set. It is the one for backgrounds, buttons and image overlays.
- Radial spreads out from a centre, as a circle or an ellipse. It suits glows and spotlights, and here the centre can sit at any of nine points, such as the top of the box for a stage light.
- Conic sweeps the colours around a centre like a clock hand. It is the right type for a colour wheel, a pie chart drawn in pure CSS or a progress ring, and every major browser has supported it, unprefixed, since late 2020.
How do you fade an image into transparency?
Put a linear gradient on top of the photo, with one stop at zero opacity. The Image overlay preset loads the most common version, a dark fade that keeps a headline readable:
background: linear-gradient(0deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 100%);
The end colour is written as rgba(0, 0, 0, 0) rather than the keyword transparent. They are the same colour, transparent black, and older browsers used to fade through grey on the way to it. Modern browsers no longer do, but writing the colour with zero alpha is the form that cannot be misread, so every stop with opacity below 100% comes out that way.
Can it make CSS background patterns?
Some of them. Turn on Repeating in the Presets panel and give two stops the same position: the colour changes with a hard edge instead of a blend, and the gradient tiles forever. That gives you stripes with linear, rings with radial and rays with conic. The Stripes preset is one example:
background: repeating-linear-gradient(45deg, #2b2d36 0%, #2b2d36 8%, #f25f3a 8%, #f25f3a 16%);
Dots, grids and checkerboards need one more ingredient, background-size, and often several gradients layered together, which this generator does not write. The checkerboard behind our own preview is a single line you can copy and adapt:
background: repeating-conic-gradient(rgba(128,128,128,.22) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
Can you animate a CSS gradient?
Not directly. A gradient is an image, and the browser cannot blend one image into another, so a transition on it jumps straight to the end. Two techniques do work. You can make the gradient larger than the element and move it with background-position, or you can register a custom property with @property and animate a value inside the gradient, such as the angle or a stop position. @property works in current Chrome, Safari 16.4 and later, and Firefox 128 and later. This tool writes the static gradient you start from.
Why does a gradient look muddy in the middle?
Because two colours far apart on the colour wheel, such as blue and yellow, pass through grey when the browser blends them. Three fixes, from simplest to newest:
- Add a middle stop with a colour you choose, so the blend never crosses the grey zone.
- Pick neighbouring colours, like blue to purple, which blend cleanly.
- Blend in a different colour space: writing
linear-gradient(in oklch, …)keeps the middle saturated in current browsers. This generator does not add it for you, so paste it in after copying.
Frequently asked questions
How do I make gradient text in CSS?
Set the gradient as the background of the text element, add background-clip: text with its -webkit- prefix, and make the text colour transparent so the gradient shows through the letters. Choose the Gradient text output in this generator and it writes all four lines with your colours, ready to paste into a heading.
Why is my gradient text showing as a solid colour?
Another rule is setting the text colour after the gradient, so the letters are painted solid on top of the clipped background. Find it in your browser inspector and remove it, or make sure color: transparent comes last. If only one colour of the gradient shows, the element is too wide: add display: inline-block.
Does gradient text work in Safari?
Yes. Safari has supported background-clip: text for years, and older versions need the -webkit-background-clip line, which this generator always includes. Overall it works in about 97% of browsers in use. If the text stays invisible, check that the gradient and the clip are on the element that directly contains the words.
How do I make a gradient that fades to transparent?
Drop the opacity slider on one of the colour stops to zero. The tool writes the colour out as rgba with zero alpha rather than the transparent keyword, which is the unambiguous form. This is the gradient behind almost every hero image on the web, darkening a photo so the text on top stays readable.
What is the difference between linear, radial and conic gradients?
A linear gradient blends along a straight line set by an angle. A radial gradient blends outwards from a centre point, as a circle or an ellipse. A conic gradient rotates the colours around a centre like a clock hand. Linear suits backgrounds, radial suits glows, and conic suits colour wheels and charts.
Can I make CSS background patterns with gradients?
Stripes, rings and rays, yes: turn on Repeating and give two stops the same position for a hard edge, and the pattern tiles forever. Dots, grids and checkerboards also need background-size and often several layered gradients, which this generator does not write. The page shows a one-line checkerboard you can adapt.
Can you animate a CSS gradient?
Not directly, because the browser cannot blend one gradient image into another, so a transition jumps to the end. Move an oversized gradient with background-position instead, or register a custom property with @property and animate the angle or a stop inside the gradient. @property works in current Chrome, Safari and Firefox.
Why does my gradient look grey or muddy in the middle?
Colours that are far apart on the colour wheel, like blue and yellow, pass through grey when the browser blends them. Add a middle stop with a colour you pick, use neighbouring colours, or write linear-gradient(in oklch, ...) so current browsers blend in a colour space that keeps the middle saturated.
Can it output Tailwind classes?
Yes. The Tailwind output gives you an arbitrary-value background class with every space already replaced by an underscore, which is the escaping Tailwind requires and the step people usually get wrong by hand. Add bg-clip-text and text-transparent alongside it to clip that same gradient to text.
How many colours should a gradient have?
Two to four usually looks best, and this tool supports up to six stops. Colours near each other on the colour wheel blend smoothly, while opposite colours pass through a muddy middle. Adding a stop in the centre lets you steer where the blend happens rather than only setting the ends.
Related tools
Rate CSS Gradient Generator & help shape it
This tool is free and still growing. Tell us what works, what you would change, and what is missing. Your feedback is what decides what we build next.
Built and tested by the ÆON Toolhub team. Last updated: October 18, 2026. How we test our tools


