CSS gradient generator
Build a linear or radial CSS gradient with up to five color stops, and copy the ready-to-paste background declaration.
Generated gradient
background: linear-gradient(135deg, #14B8A6 0%, #6366F1 100%);
How it works
A CSS gradient generator builds a linear-gradient() or radial-gradient() value visually, so you can pick colors and positions with a live preview instead of guessing the syntax by hand.
- Choose linear or radial
Linear follows an angle; radial spreads outward from the center.
- Set the angle and stops
Drag the angle slider, then set each stop's color and position from 0 to 100%.
- Copy the CSS
The background declaration updates live and is one click to copy.
Using the generated CSS
Paste the copied line onto any block element's background or background-image property:
.hero { background: linear-gradient(to bottom, #0f172a 0%, #1e3a5f 60%, #0f172a 100%); }
Gradients cannot be applied directly to color or border-color. For a text gradient, apply the gradient as a background on the text element, then add background-clip: text and color: transparent.
Linear vs. radial
- Linear: stops travel along a straight line at the chosen angle. 0deg points to the top, 90deg to the right, 180deg to the bottom, and 270deg to the left.
- Radial: stops travel outward from the center in a circle. This tool always centers the radial gradient; for an off-center or elliptical radial gradient, edit the generated value by hand and add a position or shape keyword.
Browser support
Both linear-gradient() and radial-gradient() work in every current browser without vendor prefixes. Older prefixed forms such as -webkit-linear-gradient() are no longer necessary.
Not covered by this tool
Conic gradients (conic-gradient()) and multiple layered gradients on one element are not generated here. Both are valid CSS you can add by hand once you have a base gradient to start from.
Frequently asked questions
How do I generate a CSS gradient with multiple color stops?
Add color stops with the Add color stop button, then set each one's hex color and percent position. The preview and the CSS line below it update as you type. Click Copy CSS to get the full declaration, for example: background: linear-gradient(135deg, #14B8A6 0%, #6366F1 100%);
What CSS property do I paste a generated gradient into?
Use the background or background-image property on any block element. Gradients cannot be applied to color or border-color directly; for a text gradient, combine background-clip: text with color: transparent on the text element.
How do I make a diagonal gradient in CSS?
Set the angle to a value between the axes, such as 45 for top-left to bottom-right or 135 for top-right to bottom-left. 0 points straight up, 90 straight right, 180 straight down and 270 straight left.
Can I add more than two color stops to a CSS gradient?
Yes, this tool supports up to five stops. Click Add color stop to append one at the midpoint between the last two, then adjust its color and position. Each stop has its own remove button once there are more than two.
Does this tool support radial gradients?
Yes. Switch Type to Radial to generate radial-gradient() instead of linear-gradient(). The radial gradient is always centered; there is no angle to set because it spreads outward evenly in every direction. Conic gradients are not supported and would need to be written by hand.