ToolSphere

CSS Gradient Generator

More tools

Create linear and radial CSS gradients with multiple color stops, angles, and presets. Preview gradients live and copy production-ready CSS code.

0%
100%
CSS
background: linear-gradient(135deg, #10b981 0%, #0f766e 100%);

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use CSS Gradient Generator

  1. 1Choose linear or radial, and set the angle for a linear gradient.
  2. 2Drag each color stop's position, or add and remove stops.
  3. 3Start from a preset if you want a tested combination.
  4. 4Copy the generated CSS straight into your stylesheet.

About CSS Gradient Generator

Building a gradient that is not a muddy band

The default two-stop gradient between two saturated colors often develops a dull grey band through the middle. That is a consequence of interpolating in sRGB: the path between two hues passes through desaturated territory. The practical fix is a third stop near the midpoint holding a saturated color, which pulls the transition away from grey.

This generator gives you linear and radial types, a free angle, and as many stops as you need, each with its own position. The CSS updates as you drag and is ready to paste.

Angles, in the order CSS means them

A linear-gradient angle points in the direction the gradient travels: 0deg runs bottom to top, 90deg left to right, 180deg top to bottom. This trips people up because it is the opposite convention to most drawing software. The live preview removes the guesswork.

Where gradients earn their place

Subtle gradients do real work: a barely-there vertical fade gives a card depth without a border, and a radial highlight behind a hero draws the eye to the headline. Heavy, high-chroma gradients under body text do the opposite — they make the text harder to read at every point along the ramp, and they make it almost impossible to keep a WCAG contrast ratio consistent, since the contrast changes across the element. If text sits on a gradient, check the worst point with the contrast checker, not the average.

For backgrounds that must stay accessible, keep the luminance range of the stops narrow and let the hue do the moving.

Frequently asked questions

Why does my gradient look grey in the middle?

Interpolating between two saturated hues in sRGB passes through desaturated territory. Add a third stop near the midpoint holding a saturated color to pull the transition away from grey.

Which way does the angle point?

The angle is the direction the gradient travels: 0deg runs bottom to top, 90deg left to right, 180deg top to bottom. It is the opposite convention to most drawing software, which is why the live preview helps.

Can I put text on a gradient and stay accessible?

Only if you check the worst point, not the average — contrast varies across the element. Keep the luminance range of the stops narrow and let hue do the moving.

How many stops is too many?

There is no technical limit, but more than four rarely improves the result and makes the gradient hard to adjust later. Two stops plus one midpoint correction covers most cases.

Have a suggestion for CSS Gradient Generator?Share your feedback ↗