CSS Gradient Generator

By the ToolPocket team · Updated 2026-12-05 · Editorial standards

Gradients are one line of CSS but fiddly to tune by hand: two colours, a direction and sometimes a third stop. This generator previews the result and writes the rule for you.

Choose linear or radial, set the angle and colours, then copy the CSS and paste it into your stylesheet. The preview updates as you type.

Runs locally in your browser — nothing is uploaded.

How to use the CSS Gradient Generator

  1. Pick two colours with the colour inputs.
  2. Choose linear or radial and set the angle.
  3. Copy the generated background CSS.

Frequently asked questions

What is the difference between linear and radial?

A linear gradient runs along a straight line at the given angle; a radial gradient spreads outward from a centre point.

Can I use more than two colours?

Yes — add a middle stop if you want a three-colour blend, then adjust its colour.

Will it work in older browsers?

The syntax shown works in every current browser. Extremely old browsers need prefixed fallbacks.

Good to know

The browser draws gradients as images, so a gradient costs nothing to download but can be expensive to paint on very large areas. Two or three colour stops are cheap; a dozen stops over a full-screen scrolling section can cost frames on weaker phones.

Colour choice matters more than the angle. A gradient between two close hues reads as depth; a gradient between opposing hues reads as a design decision that competes with the content. Test the text contrast at both ends before shipping.