How to use CSS Gradient Generator
- Choose Linear or Radial, then set the angle (linear) or the shape (radial).
- Pick the colors and their positions, and add or remove stops (2 to 5).
- Check the live preview, then copy the CSS line and paste it into your stylesheet.
Features
- Linear gradients with an angle in degrees and a slider
- Radial gradients with circle or ellipse shape
- Between 2 and 5 color stops, each with its own position
- Live preview that updates as you change anything
- One-click copy of a complete background declaration
Examples
| Input | Result |
|---|---|
| Linear, 90°, #4F33E8 at 0%, #22C55E at 100% | background: linear-gradient(90deg, #4F33E8 0%, #22C55E 100%); |
| Radial, circle, #FFFFFF at 0%, #000000 at 100% | background: radial-gradient(circle, #FFFFFF 0%, #000000 100%); |
Limitations
- Stops are sorted by position in the output, as CSS expects. The tool creates simple gradients with solid colors; it does not add transparency, repeating gradients, conic gradients or custom radial positions. Always test a gradient behind text for contrast.
Learn more
Gradients add depth to backgrounds, buttons and hero sections without loading an image file. In CSS they are generated by the browser, scale to any screen size and cost only a few bytes, which is better for performance than a large background picture.
A linear gradient is defined by a direction and a list of color stops, each a color and a position along the line. A radial gradient replaces the direction with a shape and spreads from the center. Stops at 0% and 100% fill the whole box; moving stops inward creates hard or soft bands. Gradients that run between two similar hues look refined, while very different hues can look harsh. If text sits on top, check contrast at the lightest and the darkest point of the area behind it.
Frequently asked questions
How do I make a CSS gradient?
Choose the type, pick your colors and positions, and copy the generated line. Paste it into a rule such as .hero { background: ... }.
What does the angle mean in a linear gradient?
It sets the direction: 0 degrees runs from bottom to top, 90 degrees from left to right, 180 degrees from top to bottom, and 270 degrees from right to left.
What is the difference between linear and radial?
A linear gradient changes color along a straight line. A radial gradient spreads outward from a center point, in a circle or an ellipse.
Can I use more than two colors?
Yes. Add up to five color stops and set the position of each one, in percent along the gradient line.
Sources
Last reviewed: September 30, 2026