Gradient Generator

Create CSS gradients with live preview

How to Create a Gradient

  1. Pick your two colors. Click each swatch to choose the color the gradient starts and ends with.
  2. Choose linear or radial. Linear blends along a straight line; radial spreads outward from the centre.
  3. Set the angle. Drag the slider to change the direction of a linear gradient. The preview updates as you go.
  4. Copy the CSS. The generated code sits below the controls โ€” click Copy CSS and paste it into your stylesheet.

What This Tool Does

Writing gradient syntax by hand means guessing at the result and reloading to check. This tool shows you the gradient at a usable size while you adjust it, then hands you the CSS to paste in. Handy for hero sections, buttons, card backgrounds, and overlays that need to sit behind text.

Everything runs entirely inside your browser, with nothing to install or sign up for.

Getting a Gradient That Looks Good

The most common disappointment is a muddy band through the middle. It happens when the two colors sit far apart on the color wheel โ€” blue to orange, say โ€” because the blend passes through the desaturated greys between them. Colors that are closer together produce a much cleaner transition, which is why analogous pairs tend to look better than complementary ones here. If you want two distant colors, route the blend through a third color that sits between them rather than letting it find its own path.

On direction: CSS angles start at 0 degrees pointing upward and increase clockwise, so 90 degrees runs left to right and 180 degrees runs top to bottom. That catches people out, and the live preview is the quickest way to settle it. Radial gradients ignore the angle entirely, since they radiate from the centre outward. One last thing โ€” if text will sit on top of the gradient, check it against both end colors with the Contrast Checker. Text that's readable at one end of a gradient often isn't at the other.

Frequently Asked Questions

Why does my gradient look grey in the middle?

The two colors are far apart on the color wheel, so the blend passes through neutral grey on its way between them. Choose closer colors, or add an intermediate color to steer the transition.

Which angle gives a top-to-bottom gradient?

180 degrees. CSS measures from 0 degrees pointing up, increasing clockwise, so 90 degrees is left to right and 180 degrees is top to bottom.

Why doesn't the angle change my radial gradient?

A radial gradient spreads outward from the centre in all directions, so there's no single direction for an angle to describe. The angle only applies to linear gradients.

Can I put text on a gradient background?

Yes, but check the contrast against both end colors. A gradient that starts light and ends dark will leave text readable at one end and not the other.