stoolme
Home/ Design/ CSS gradient generator

CSS gradient generator

Compose a linear or radial CSS gradient with two to five color stops. Copy the result and paste it into your stylesheet.

What this tool does

CSS gradients let you fill an element with a smooth color transition without using an image. This tool lets you compose either a linear or radial gradient interactively, with up to five color stops, then copy the resulting CSS into your stylesheet.

Linear vs radial

A linear gradient transitions along a straight line. You specify the direction either as an angle (135deg) or with a keyword (to right, to bottom left). 0deg is bottom-to-top; angles increase clockwise. The default if you don't specify direction is to bottom (180deg).

A radial gradient transitions outward from a center point. You can specify the shape (circle or ellipse), size (closest-side, farthest-corner, etc.), and position. The simplest form is just circle, which centers a circular gradient.

Color stops

Each stop is a color paired with a position percentage (0–100). Stops are sorted in increasing position before being rendered. Between two stops, the browser smoothly interpolates the color in sRGB by default. Modern browsers also support linear-gradient(in oklch, …) for perceptually smoother transitions, but support is still rolling out.

Tips

  • For a hard color edge, place two stops at the same position (e.g. #000 50%, #fff 50%).
  • For a subtle gradient, place the same color at both endpoints with a slightly lighter or darker variant in the middle.
  • Avoid extreme banding by using colors with similar luminance.
  • Performance: gradients are GPU-accelerated; you can animate angle and position cheaply.

Browser support

Linear and radial gradients have been universally supported since 2012. The newer conic-gradient and gradient-color-space syntax (in 2023+ browsers) are not exposed in this tool but are part of the same family.

Privacy

The gradient is composed entirely in your browser.

Frequently asked questions

How do I make a diagonal gradient?
Use an angle. 45deg gradients go from bottom-left to top-right; 135deg gradients go from top-left to bottom-right. The default direction (no angle specified) is "to bottom" (180deg).
Why does my gradient look muddy in the middle?
Default sRGB interpolation can produce gray midpoints between bright colors. Use HSL or OKLCH colors with similar luminance, or add a midpoint color stop.
Can I have a hard color stop?
Yes. Place two stops with different colors at the same position. The browser draws a sharp boundary instead of a gradient.
Do gradients hurt page performance?
No, they are GPU-accelerated. You can animate gradient parameters at 60 fps without measurable impact.
Why does the radial gradient look elliptical, not circular?
The default shape is ellipse, scaled to the element. Specify circle to force a circular shape.