CSS Gradient Generator
Adjust CSS gradients and generate code
Preview
Color stops
Click the band to add a color stop at that position.
background-image: linear-gradient(135deg, #6366f1 0%, #d946ef 50%, #fb923c 100%);Settings
What is CSS Gradient Generator?
CSS Gradient Generator creates linear-gradient and radial-gradient CSS and lets you preview the result as a background. Start from a preset, then adjust color stops, opacity, and angle to build backgrounds for hero sections, cards, buttons, and more.
How to Use
- Pick a preset close to your palette, or choose a gradient type.
- Adjust the color, position, and opacity of each color stop.
- Choose an output format and color notation, then copy the code.
Main Settings
Gradient Type
Switch between linear and radial gradients. Linear gradients flow in one direction, while radial gradients spread from a center point. For radial gradients, you can also choose where that center sits.
Angle
This setting applies to linear gradients and accepts values from 0 to 360 degrees. At 0deg, colors flow from bottom to top; at 90deg, they flow from left to right.
Color Stops
Color stops define where one color changes into the next. The list shows each stop's color and position, and selecting a row lets you adjust its color, opacity, and position. You can add, move, or delete stops, and positions run from 0 to 100%. Distribute spreads them evenly. Lowering opacity lets the content behind the gradient show through.
Presets
Presets give you a starting palette. Each one replaces the gradient type, angle, and color stops, so you can refine the values from there.
Output
Copy the result as a CSS declaration or as a Tailwind v4 utility class. You can also switch the color notation to OKLCH. The output matches the preview.
Use Cases
- Giving hero sections and banners a background with more depth than a flat color
- Adapting button and card backgrounds to a palette
- Building fade or overlay layers with transparent stops
Things to Keep in Mind
- OKLCH gradients display in relatively recent browsers, so check the result in the environment where you will use them.
Last updated:

