CSS Gradient Generator
Create beautiful CSS gradients visually. Copy the code and paste it into your project.
background: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);
Best for: Building a linear, radial or conic gradient and copying the CSS straight into a stylesheet, and adjusting angle and colour stops visually
Limitations: Outputs CSS gradient code only, so it does not export a PNG or SVG for use in a design tool
Best suited for: Front-end developers who want gradient CSS without hand-writing colour stop syntax
How the Generator Builds Its CSS
Pick Linear, Radial or Conic, set the angle (Linear only, 0 to 360deg) and edit the color stops. The CSS box shows exactly what the preview uses, such as background: linear-gradient(135deg, #7C3AED 0%, #06B6D4 100%);. Radial output always starts radial-gradient(circle, and Conic output conic-gradient(from 0deg,, with no control for shape, center or start angle. The eight Quick Presets are all linear: six at 135deg, Neon at 90deg and Minimal at 180deg.
The stop list keeps the order you added stops in, but the CSS writes them sorted by position, lowest first, and stops at the same position stay in list order. The preview and the Copy button use that same CSS. The generator never adds a color interpolation method such as in oklab, so every gradient it outputs uses the browser default described below.
Why the Middle of a Gradient Goes Muddy
CSS Color 4 says legacy sRGB colors, which include the hex codes this tool writes, interpolate "in gamma-encoded sRGB space" by default. Between two far-apart hues every channel lands near its middle value, so the color drains out. One pair, computed with this site's own code and rendered in Chromium 148 (method):
| CSS | Midpoint computed | Midpoint rendered | Oklab chroma |
|---|---|---|---|
background: linear-gradient(to right, #2563EB, #F59E0B); | #8D817B | #8D807B | 0.017 |
background: linear-gradient(in oklab to right, #2563EB, #F59E0B); | #938EA4 | #938DA3 | 0.033 |
The rendered pixels differ from the computed midpoints by at most one unit per channel. Both midpoints are low in chroma because blue and amber sit nearly opposite each other, but Oklab keeps about twice as much. To use it here, copy the CSS and type in oklab before the angle: linear-gradient(in oklab 135deg, #7C3AED 0%, #06B6D4 100%). More in the CSS gradient guide and on fixing muddy gradients.