Free CSS Gradient Generator
The Gradient Generator lets you build linear and radial CSS gradients with a live preview. Adjust the angle, colors, and stops, then copy the CSS.
Gradients are usually combined with the Glassmorphism CSS Generator and the CSS Box Shadow Generator. To build a palette the gradient can draw from, the Color Harmony Generator is the starting point.
How to use the CSS Gradient
- 1 Choose a gradient type: linear, radial or conic.
- 2 Add colour stops and drag them along the axis to position them.
- 3 Set the angle for a linear gradient, or the position for a radial one.
- 4 Copy the generated `background` declaration.
Making a gradient look intentional
A two-stop gradient from one colour to another is the default and usually the weakest option. Interpolation between distant hues passes through muddy intermediate colours, so a blue-to-yellow gradient runs through grey. Adding a mid stop that is a deliberate mix, rather than whatever the interpolation produced, keeps the whole ramp vivid.
Subtlety does a lot of work here. A gradient between two values that are close together reads as a lighting effect on a surface, which is what most interfaces actually want. Strong hue shifts read as decoration, which is a different and much more fragile choice.
- Add a mid stop to control what the interpolation passes through.
- Keep stops close in hue for a surface effect.
- Use `transparent` carefully — it interpolates from black in some browsers.
- Conic gradients are the basis of conic charts and colour wheels.
Frequently asked questions
What is the difference between a linear and a radial gradient?
A linear gradient interpolates along a straight line defined by an angle, which suits a background that gets lighter toward one side. A radial gradient interpolates outward from a centre point, which suits a spotlight or a glow. A conic gradient rotates around a centre, which is used for pie charts and colour wheels.
Why do my gradients look banded or striped?
Because the interpolation happens in sRGB, which is not perceptually uniform. Across a gradient between two distant colours, the perceived change is not smooth and visible steps appear. The fix is either to add intermediate colour stops to smooth the transition, or to interpolate in a better colour space by specifying a hue interpolation method.
Are gradients hard on performance?
Generally no for static backgrounds, because they are painted once. Animating a gradient is a different matter, since interpolation itself would have to be recomputed. For animation, the cheap approach is to keep the gradient static and animate something over it — the background position of an oversized gradient, for example.
Related Developer Tools
You might also need
Tools from other categories that people pair with the CSS Gradient: