CSS Gradient Generator

Pick two colors and an angle, watch the preview update, then copy the CSS background rule or download the gradient as a 1200 × 800 PNG.

Colors and angle

Live preview

PNG export is 1200 × 800 pixels. The CSS fills any element size.

How to make a CSS gradient

  1. Choose a starting color and an ending color.
  2. Drag the angle slider. 90° runs left to right, 180° top to bottom, and 45° diagonally from the bottom left.
  3. Click Copy CSS and paste the rule into your stylesheet, or download a PNG for slides, social posts or design files.

Reading the CSS

The generator writes a rule like background: linear-gradient(90deg, #1d4ed8 0%, #5eead4 100%);. The angle sets the direction the gradient travels, following the CSS convention where 0deg points up and angles turn clockwise. The percentages are color stops: the first color is solid at the start and blends evenly into the second at the end.

AngleDirectionSame as
0degbottom to topto top
90degleft to rightto right
180degtop to bottomto bottom
270degright to leftto left
45degbottom left to top rightto top right on a square

Gradients in CSS are generated by the browser, so they cost no download, scale to any size and stay perfectly smooth, unlike a stretched image.

When to download the PNG

Use the PNG when the destination cannot run CSS: presentation slides, social media posts, video thumbnails, email newsletters or design tools. The export is 1200 × 800 pixels and drawn on a canvas in your browser with the same angle. If you need another size, resize it afterwards with the image resizer; a gradient has no fine detail, so it scales without visible loss.

Smooth gradients between very different colors can show faint banding in 8-bit images. Choosing colors with a similar lightness, or adding a midpoint color by hand in your CSS, keeps the blend smooth.

Design tips

  • Keep text readable. Check contrast against both ends of the gradient; WCAG 2 asks for 4.5:1 for body text.
  • Neighboring hues blend best. Blue to teal or orange to pink look natural; complementary colors meet in a grey middle.
  • Subtle works. Two shades of one color make a calm background for cards and headers.
  • Build a set. Take colors from the palette generator to keep gradients on brand.

A gradient also makes a good placeholder while real images load: set it as the background of an image container and the page shows a soft color block instead of an empty box. Because CSS gradients are drawn by the browser, they add no bytes to download and never need compressing.

Frequently asked questions

How do I use the gradient on my website?

Click Copy CSS and paste the background rule into the CSS for the element you want to fill, such as a header or a button.

Which direction does the angle go?

In CSS, 0 degrees points upward and angles turn clockwise, so 90 degrees runs left to right and 180 degrees runs top to bottom.

What size is the PNG download?

1200 by 800 pixels. Resize it with the image resizer if you need different dimensions.

Can I add more than two colors?

This tool makes two-color gradients. You can add stops by hand in the copied CSS, for example a third color at 50%.

Why do I see stripes in my gradient?

That is banding, caused by the limited number of color steps in 8-bit images. Colors with similar lightness or a small amount of noise in a design tool reduce it.

Do CSS gradients work in all browsers?

Yes. linear-gradient is supported by every current browser without prefixes.

Is anything uploaded?

No. The preview, CSS and PNG are all created in your browser.

Can I use the gradients commercially?

Yes. The CSS and PNG you create are yours to use anywhere.