CSS gradient generator
Set the colours and direction, watch the preview, and copy one line of CSS.
- 100% free
- No sign-up
- Runs in your browser
How to use CSS gradient generator
- Choose the type
- Set the colour stops
- Copy the CSS
CSS
background: linear-gradient(135deg, #3a5bd9 0%, #c54f80 100%);
Colour stops
Each stop is a colour and where it sits along the gradient, from 0 to 100. Leave the position empty to let stops space themselves evenly.
Ready-made gradients
Next: Color palette generator · Contrast checker · CSS formatter & minifier
Report a problem with this tool
How to use CSS gradient generator
Choose the type
Linear with a direction, radial as a circle or ellipse around a centre point, or conic sweeping around a centre from a start angle.
Set the colour stops
Give each stop a colour, an opacity and a position from 0 to 100. Add up to 8 stops, remove them or swap their colours.
Copy the CSS
The background declaration updates as you edit. Copy it into your stylesheet, or download the gradient as a 1600 × 900 PNG.
Why use Utils365
All three gradient types
linear-gradient, radial-gradient and conic-gradient, written the standard way so they work in every current browser.
Transparency shown honestly
See-through stops are previewed over a checkerboard and written as 8-digit HEX or rgba(), whichever you prefer.
Tidy output
Stops are written in order of position, with angles and positions rounded to one decimal place.
Quick starting points
Seven ready-made gradients and a Random button give you something to adjust instead of a blank page.
Frequently asked questions
How do I use the CSS it gives me?
Paste the line into the rule for the element you want to fill, for example .hero { background: linear-gradient(135deg, #3a5bd9 0%, #c54f80 100%); }. Gradients are images in CSS, so they also work in background-image.
Which way does the angle point?
As in CSS, 0° points up, 90° to the right, 180° down and 270° to the left, and the gradient runs in that direction. For a conic gradient the angle is where the sweep starts, with 0° at the top, going clockwise.
What is a colour stop?
A colour and the point along the gradient where it is at full strength, from 0 to 100 percent. Between two stops the colours blend. Give two stops the same position to get a hard edge instead of a blend.
What if I leave a position empty?
The stop spaces itself, as in CSS: the first sits at 0%, the last at 100% and others evenly between their neighbours. If every position is empty, the CSS lists only the colours.
What do the arrows on a stop do?
They swap that stop’s colour with the one before or after it, while the positions stay put. In the CSS, stops are always written in order of position.
How big is a radial gradient?
It uses the CSS default, farthest-corner: the last colour is reached at the corner of the box farthest from the centre. Circle keeps it round; ellipse stretches it to the proportions of the box.
Does the PNG match the CSS?
It is drawn at 1600 × 900 pixels with the same geometry, including transparency, so it matches closely; fades between see-through colours can differ very slightly. A box with other proportions will show the same gradient stretched to fit.