About the Gradient Generator
Gradient Generator makes smooth gradient backgrounds for a website, slide or mockup. Start from a preset or the Random button, add as many color stops as you like, choose linear, radial or conic, and copy the CSS or a link that reopens the same gradient.
How it works
The tool writes a CSS gradient function from your settings. Linear gradients use an angle (0deg runs bottom to top, 90deg left to right), radial gradients use a circle or ellipse shape and a center position, and conic gradients sweep colors around a center point starting from the chosen angle. Each color stop has a position from 0% to 100%, and stops are listed in order of position.
Ticking Repeating switches to repeating-linear-gradient (or the radial and conic versions), which tiles the pattern once the last stop is reached, useful for stripes. The copied CSS includes a solid background color first as a fallback, then the gradient.
How to use
- 1
Pick Linear, Radial or Conic, or start from a preset or the Random button.
- 2
Set each color stop's color and drag its position; use Add stop for more colors.
- 3
Adjust the angle, or the shape and center for radial and conic gradients.
- 4
Click Copy to copy the CSS and paste it into your stylesheet.
Worked examples
Default blue to purple
A quick blue-to-purple hero background.
Diagonal sunset
A warm card background running from top-left to bottom-right.
Spotlight effect
A soft glow in the middle of a dark panel.
Frequently asked questions
How many colors can I add to a gradient?+
As many as you like. Click Add stop to add a color between the two furthest-apart stops, then adjust its color and position.
Can I preview the gradient before copying the code?+
Yes. The preview box at the top updates as soon as you change a stop, the type or the angle.
Which direction does 0deg go?+
In CSS, 0deg runs from bottom to top, 90deg from left to right and 180deg from top to bottom.
What's the difference between linear and radial gradients?+
A linear gradient changes color along a straight line at a set angle. A radial gradient spreads outward from a center as a circle or ellipse, and a conic gradient sweeps around a center point.
Do CSS gradients slow down my page?+
No. They're drawn by the browser, need no image download, and scale cleanly to any screen size.