Generate linear or radial CSS gradients with up to 8 color stops. Adjust angle and stop positions with a live preview, then copy the gradient CSS.
background: linear-gradient(135deg, #6366F1 0%, #EC4899 100%);
CSS gradients enable smooth visual transitions between two or more designated colours. Because CSS gradients are computed mathematically by the browser rendering engine, they scale infinitely without resolution pixelation and eliminate the performance overhead of loading external raster background images.
| Gradient Type | Syntax Structure | Visual Appearance | Common Application |
|---|---|---|---|
| Linear | linear-gradient(direction, color-stops) | Straight line progression at specified angle | Hero banners, buttons, card borders |
| Radial | radial-gradient(shape size at position, stops) | Circular or elliptical radiating from a central focal point | Vignettes, spotlights, ambient lighting |
| Conic | conic-gradient(from angle at position, stops) | Rotates around a centre origin (like a radar sweep) | Color wheels, pie charts, loading spinners |
Gradients transition smoothly between explicit color stops. By specifying percentages, you control where each transition begins and finishes:
/* Subtle 3-stop angled hero background */
.hero-gradient {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
}
/* Hard color stop (sharp split-color background) */
.split-background {
background: linear-gradient(90deg, #f8fafc 50%, #0f172a 50%);
}
When interpolating between two saturated colours using standard sRGB colour space (e.g., blue to yellow), the mathematical midpoint frequently dips through an unappealing desaturated grey zone.
Modern CSS Color Module Level 4 supports perceptual colour spaces like in oklab or in oklch:
/* Vibrantly interpolated gradient using OKLCH */
.vibrant-gradient {
background: linear-gradient(to right in oklch, #0070f3, #f5a623);
}
background-image: gradient declaration to ensure readable contrast on legacy browsers or high-contrast modes.This website and utility are provided for general informational, calculation, and educational purposes only. Always verify critical computation outputs prior to professional deployment or financial use. See our Terms of Service and Privacy Policy for full governance details.