CSS Gradient Generator

Design CSS gradients visually: pick colors, adjust angle, preview live and copy the code. Supports linear and radial gradients with 2–5 color stops.

Ad space — add Google AdSense after the site has useful content and is ready for review.
Your result will appear here.

CSS Gradient Generator online

Build CSS linear and radial gradients visually — set color stops, positions and angle, preview the result live and copy production-ready CSS.

How it works

The tool builds a standard CSS linear-gradient() or radial-gradient() string from your stops. Each stop has a color (HEX/RGB) and a position (0–100 %). For linear gradients you set the angle (0–360°, 0 = to right, 90 = to bottom). For radial you pick shape (circle/ellipse) and center position. The preview updates in real time; clicking Copy CSS puts the background: linear-gradient(...) rule on your clipboard.

Worked example

Linear, 3 stops: #667eea at 0 %, #764ba2 at 50 %, #f093fb at 100 %, angle 135°. Output: background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);. Preview shows a smooth purple-pink transition.

Presets

Click any preset card to load a ready-made gradient: Sunset, Ocean, Forest, Fire, Midnight, Pastel. Modify any stop to customize.

Practical tips

  • Gradients are rendered by the browser — zero bytes over the wire, unlike gradient images.
  • Keep stops to 2–3 for clean, performant gradients; more stops increase paint cost slightly.
  • Use background-size + background-repeat for pattern effects (e.g., stripes).
  • Test contrast if placing text over the gradient — pair with the Contrast Checker.

Edge cases and limitations

  • Stops bunch, colors band. Two stops a few percent apart create a hard stripe, and smooth gradients over large areas can band visibly on 8-bit displays. A near-imperceptible second stop or a touch of noise texture hides banding better than adding more stops.
  • Midpoints are not halfway. Between two colors, the visual midpoint rarely sits at 50%: interpolating in sRGB (what CSS does by default) drags blends through muddy greys — red to blue passes through a desaturated purple-brown. Modern CSS lets you pick the interpolation space (for example in oklch) in the generated string if your browser targets support it.
  • Text on top needs a contrast check. A gradient background means text contrast changes along its length; check the text color against the lightest stop with the Contrast Checker before shipping the hero section.
  • Angles differ between syntaxes. In standard CSS, 0deg points up and angles run clockwise; the old prefixed syntax counted differently. The generator outputs the standard form — if you hand-edit the angle from an old tutorial, your gradient will lean the wrong way.

Privacy and browser processing

The generator runs entirely in your browser — your colors and presets are never uploaded.

Frequently asked questions

Can I use the generated CSS in production?

Yes. The output is standard CSS linear-gradient() / radial-gradient() supported by all modern browsers (IE10+ with prefixes, unprefixed since ~2012).

What's the difference between linear and radial?

Linear: colors transition along a straight line at the given angle. Radial: colors radiate from a center point in an ellipse or circle.

Can I animate the gradient?

CSS gradients cannot be animated directly with transition. For animation, use a pseudo-element with background-position on a larger gradient, or animate opacity of layered gradients.

Does the tool generate vendor prefixes?

Modern browsers (last 5+ years) support unprefixed gradients. If you need IE9/old Android support, run the output through Autoprefixer in your build pipeline.

Related tools

Ad space