Design tool
CSS Gradient Generator
Design linear, radial and conic CSS gradients with unlimited colour stops and alpha. Copy the CSS or a Tailwind class, or download a 1920x1080 PNG.
Free, no sign-up. Runs in your browser; nothing is uploaded.
Preview
Presets
Gradient
Colour stops (3)
- #1%%
- #2%%
- #3%%
Stops are sorted by position when you finish editing. A hex with 8 digits sets opacity too.
CSS
CSS background
background: linear-gradient(120deg, #ff512f 0%, #f09819 50%, #dd2476 100%);
CSS background-image
background-image: linear-gradient(120deg, #ff512f 0%, #f09819 50%, #dd2476 100%);
Tailwind arbitrary value
bg-[linear-gradient(120deg,#ff512f_0%,#f09819_50%,#dd2476_100%)]
How to use the css gradient generator
Create a gradient in a minute
- Pick a type: linear for backgrounds and buttons, radial for glows and spotlights, conic for dials and colour wheels.
- Start from one of the presets or press Random until something catches your eye.
- Adjust the stops. Each stop has a colour, an alpha value and a position from 0 to 100. Add as many as you like; the list reorders itself by position.
- Copy the CSS, or download a 1920x1080 PNG for slides and wallpapers.
Controls explained
- Angle (linear): 0deg points up, 90deg points right, 180deg points down. The direction buttons set the common eight values.
- Shape and extent (radial): circle or ellipse, and how far the gradient reaches: to the closest side, the farthest side, or a corner. Position moves the centre.
- From angle (conic): rotates where the sweep begins. Repeat the first colour as the last stop for a seamless wheel.
- Repeating: tiles the section between your first and last stop, which is how stripes and rings are made. Use stops like 0%, 10%, 10%, 20% for hard-edged bands.
Tips for better-looking gradients
- Keep neighbouring hues close. Gradients between far-apart colours can pass through a muddy grey; add a middle stop to steer them.
- Place two stops at the same position to create a hard edge instead of a blend.
- Use a small amount of alpha on the last stop to fade a gradient into the page background.
- For text over a gradient, check contrast against both ends of the gradient, not only the middle.
Using the output
Paste the background line into your stylesheet. The background-image version is useful when you also set background-color as a fallback, or layer several backgrounds with commas. The Tailwind class goes straight into your markup.
Frequently asked questions
What is the difference between linear, radial and conic gradients?
A linear gradient blends colours along a straight line at an angle. A radial gradient blends outward from a centre point in a circle or ellipse. A conic gradient sweeps colours around a centre point like a colour wheel or pie chart.
How do I make a gradient with transparency?
Lower the alpha on any stop. The output switches that stop to an rgba() value. The checkerboard behind the preview shows how much of the page behind it will show through.
Why does my repeating gradient look like a normal one?
A repeating gradient tiles the span between its first and last stop. If your stops already run from 0% to 100% there is nothing left to repeat. Move the last stop to something like 20% to see the pattern.
How do I use the Tailwind output?
The Tailwind snippet is an arbitrary-value class such as bg-[linear-gradient(90deg,#ff0000_0%,#0000ff_100%)]. Spaces inside the value are written as underscores, and it works in Tailwind 3 and 4 without any config.
Does the PNG match the CSS exactly?
It is drawn with the canvas gradient APIs using the same angle, stops, centre and extent, at 1920x1080. Tiny differences in colour interpolation near transparent stops are possible, but it is meant for wallpapers, mockups and social images.