CSS Gradient Generator
Build linear and radial CSS gradients with a live preview and copy the code. Runs entirely in your browser. Nothing is sent to any server.
background: #2563eb; background: linear-gradient(90deg, #2563eb 0%, #db2777 100%);
What is a CSS gradient?
A CSS gradient is an image the browser draws from a list of colors, blending smoothly between them, so it needs no file to download and stays sharp at any size. A linear gradient blends along a straight line at the angle you choose, and a radial gradient spreads out from the center as a circle or an ellipse. Each color is a stop with a position along the way. This generator lets you pick the type, angle and up to six color stops, shows a live preview and writes the CSS, with a solid fallback color first.
Examples
The same gradient written for different targets:
background: #2563eb;
background: linear-gradient(90deg, #2563eb 0%, #db2777 100%);<div class="bg-gradient-to-r from-blue-600 to-pink-600"></div>element.style.background =
"radial-gradient(circle, #2563eb 0%, #db2777 100%)";const g = ctx.createLinearGradient(0, 0, width, 0);
g.addColorStop(0, "#2563eb");
g.addColorStop(1, "#db2777");
ctx.fillStyle = g;<linearGradient id="g">
<stop offset="0%" stop-color="#2563eb" />
<stop offset="100%" stop-color="#db2777" />
</linearGradient>Use Cases
Hero sections and banners
Give a landing page header depth with a two or three color gradient instead of a heavy background image.
Buttons and badges
A subtle gradient between two close shades makes a call to action stand out without a different color.
Image overlays
Layer a gradient from transparent to dark over a photo so white text on top stays readable.
Placeholders and avatars
Generate colorful backgrounds for empty states, loading cards or default user avatars with no image assets.