CSS Gradient Generator

Add and drag color stops, pick linear, radial or conic, then copy CSS, a Tailwind class or SVG.

Presets

Code

background: #7C5CFF;
background: linear-gradient(135deg, #7C5CFF 0%, #FF6FB5 50%, #FFB86B 100%);

Save image

Image size

Build a gradient visually, then take it with you. Add color stops, drag them into place, choose linear, radial or conic, and copy the CSS, a Tailwind class or an SVG. Your gradient lives in the page address, so a link is all you need to share it.

How to use the gradient generator

  1. Pick your colors. Click a swatch to open the color picker, or type a HEX value. You can use up to 10 color stops, and every stop can be removed again once you have more than two.
  2. Place the stops. Drag the round markers on the color bar, or focus one and press the arrow keys (hold Shift to move 10% at a time). Click the bar to add a stop exactly where you click.
  3. Shape it. Choose linear, radial or conic and set the angle. The quick buttons snap to 45° steps. Turn on OKLCH interpolation if the middle of your gradient looks gray or muddy.
  4. Try something new. Press Space for a random gradient, or start from one of the presets.
  5. Take it with you. Copy the CSS, the Tailwind class or the SVG, or download a PNG in 1920×1080, 1080×1080 or 1080×1920. Press S to keep it in your favorites.

Linear, radial and conic gradients in CSS

Linear gradient

A linear gradient blends colors along a straight line. The angle sets the direction: 0deg runs from the bottom to the top,90deg from left to right and 180deg from top to bottom. The default 135deg goes diagonally from the top-left corner to the bottom-right, which is why it is so common for hero backgrounds, buttons and cards.

background: linear-gradient(135deg, #7C5CFF 0%, #FFB86B 100%);

Radial gradient

A radial gradient spreads outward from a center point, so the first color sits in the middle and the last color at the edges. It is the right choice for spotlights, soft glows behind a card and vignettes. Because it has no direction, the angle is not used.

background: radial-gradient(circle at center, #7C5CFF 0%, #FFB86B 100%);

Conic gradient

A conic gradient sweeps its colors around a center point, like the hands of a clock or a color wheel. The angle sets where the sweep starts. Use it for pie charts, color wheels, loading rings and the shiny look of metallic buttons.

background: conic-gradient(from 135deg at center, #7C5CFF 0%, #FFB86B 100%);

Color stops and OKLCH interpolation

Each color stop is a color and a position in percent. Two stops at 0% and 100% give the classic two-color gradient, and every extra stop adds another color along the way. Stops placed close together create a harder edge, and stops at the same position create a sharp line.

By default, browsers blend colors in the sRGB color space. When the two colors are far apart on the color wheel, that can leave a dull gray band in the middle. Adding in oklch to the gradient makes the browser blend in OKLCH instead, which keeps lightness and saturation steady and produces a cleaner transition. All current browsers support it, and the generated CSS starts with a plain color and an sRGB version, so older browsers still show something sensible.

The Tailwind output is an arbitrary-value class such as bg-[linear-gradient(135deg,#7C5CFF_0%,#FFB86B_100%)]. SVG has no conic gradient, so the SVG export draws a conic gradient as 90 thin wedges, while linear and radial gradients stay true SVG gradients.

More from Colorset

Looking for something ready to use? Browse 3,308 CSS gradients and tweak any of them. Need a full color scheme instead? Try the palette generator or explorecolor palettes with live previews.