CSS Gradient Generator

Adjust the colors and angle to design a gradient, then copy the CSS or download it as an image.

Loading tool…

  • Free
  • No sign-up
  • Runs in your browser

How to use the css gradient generator

  1. Choose Linear, Radial or Conic.
  2. Click a color square to change it, and drag its slider to move the stop.
  3. Press Add color for more stops, or try a preset.
  4. Press Copy CSS, or Download PNG for a 1920 × 1080 image.

The three gradient types

TypeWhat it doesCSS
LinearColors blend along a straight linelinear-gradient(135deg, #3b5bfd 0%, #ec4899 100%)
RadialColors spread outward from the centerradial-gradient(circle, #3b5bfd 0%, #ec4899 100%)
ConicColors sweep around the center like a color wheelconic-gradient(from 0deg, #3b5bfd 0%, #ec4899 100%)

Angles

In CSS, 0deg points up, 90deg points right, 180deg points down and 270deg points left. You can also write directions in words, such as to right or to bottom right.

Using the code

Paste the copied line into any CSS rule:

.hero { background: linear-gradient(135deg, #3b5bfd 0%, #ec4899 100%); }

Gradients are supported by every current browser with no prefixes, and they cost nothing to download because the browser draws them.

Design tips

  • Pick neighbors. Colors close together on the color wheel, such as blue to purple, blend smoothly. Opposites such as red to green turn muddy in the middle.
  • Fix a gray middle by adding a third stop of a brighter color between the two ends.
  • Keep text readable. Check both ends of the gradient with the contrast checker, not just the middle.
  • Hard stripes: give two stops the same position to create a sharp edge instead of a blend.
  • Text gradients: add background-clip: text; color: transparent; to apply the gradient to lettering.

Download the PNG if you need the gradient as a wallpaper, slide background or social media image.

Frequently asked questions

How do I add a gradient background in CSS?

Use the background property with a gradient function, for example background: linear-gradient(90deg, #ff512f, #f09819);

Can I use more than two colors?

Yes. Press Add color to add as many stops as you like.

Can I save the gradient as an image?

Yes. Download PNG saves a 1920 × 1080 picture.

Is it free?

Yes. There is no account, no limit and no watermark.

Related tools