EN

CSS Gradient Generator

Choose a gradient type, adjust the angle or center, edit up to five color stops and copy the CSS. The preview uses exactly the code you copy.

Type
Color stops
CSS
background: #8B5CF6;
background: linear-gradient(135deg, #8B5CF6 0%, #F472B6 100%);
Tailwind
bg-[linear-gradient(135deg,#8B5CF6_0%,#F472B6_100%)]

How to use it

  1. Choose Linear, Radial or Conic.
  2. Linear: set the angle (0deg points up, 90deg to the right). Radial: choose circle or ellipse and move the center. Conic: set the start angle and center.
  3. Edit the color stops: change a color, type a position from 0 to 100%, add a stop (up to 5) or remove one (at least 2).
  4. Copy the CSS (with a solid fallback color) or the Tailwind arbitrary-value class.

The CSS this tool writes

A linear gradient looks like linear-gradient(135deg, #8B5CF6 0%, #F472B6 100%): an angle, then colors with positions. A radial gradient starts from a shape and a center: radial-gradient(circle at 50% 50%, ...); it has no angle. A conic gradient sweeps colors around a center: conic-gradient(from 0deg at 50% 50%, ...). All three are part of CSS Images Level 3/4 and work in every current browser. The copied block adds a plain background color first, so very old browsers still show the first color.

Tips for smoother gradients

  • Two stops at the same position make a hard edge (a stripe) instead of a blend.
  • Blends between two saturated opposite colors can look grey in the middle; add a stop with an in-between hue to keep it bright.
  • Keep text on a gradient readable: check the darkest and lightest part with the contrast checker.

Need ideas? Browse ready-made gradients or read our CSS guides.

Frequently asked questions

What is the difference between linear, radial and conic gradients?

Linear blends colors along a straight line at an angle, radial blends outward from a center point as a circle or ellipse, and conic sweeps colors around a center like a color wheel or pie chart.

Can I use the gradient as a background image?

Yes. The copied value works anywhere CSS accepts an image, for example background, background-image or border-image. It scales to any size because the browser draws it.

How many colors can a gradient have?

CSS has no small limit, but this tool keeps it to 2-5 stops so the controls stay simple. You can add more stops by hand in the copied code.

Why does 0deg point up?

In CSS, linear-gradient angles start at the top (0deg) and turn clockwise: 90deg is to the right, 180deg is down. That differs from math class, where 0 degrees points right.

Related tools