CSS Gradient Generator
Design linear, radial and conic gradients with multiple colour stops, preview them live and copy ready-to-use CSS.
Gradient type
Presets
Colour stops (2/10)
- %
- %
background-color: #6e65c6; background-image: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
Gradients without image files
A CSS gradient is an image the browser draws itself, so it costs no download, scales to any size and can be changed with a single line of CSS. Gradients are used for hero backgrounds, overlays that keep text readable on top of photos, progress rings, subtle button surfaces and decorative stripes. The syntax is compact but fiddly (angles, positions, shape keywords, stop order), which is why a visual editor saves time: you see the result while you adjust it and copy CSS that already works.
How to use it
- Choose the Gradient type: linear, radial or conic. Tick Repeating to tile the pattern.
- Set the geometry: Angle for linear (or use the arrow shortcuts), Start angle and Centre X/Y for conic, Shape, Size and centre for radial.
- Edit the Colour stops: pick a colour or type a hex code, then set Position and Opacity. + Add stop inserts a blended colour in the biggest gap; ✕ removes a stop (minimum two).
- Or click a Preset thumbnail as a starting point.
- Click Copy CSS. Keep Solid fallback colour ticked to include a
background-colorline.
Worked example
The default gradient (two stops, 90°) produces:
background-color: #6e65c6; background-image: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
Switch to conic with a start angle of 45° and the centre at 50% 50%, and the value becomes conic-gradient(from 45deg at 50% 50%, #667eea 0%, #764ba2 100%). The from part rotates where the sweep starts, which is how you align a conic gradient with a pie chart or a progress ring.
What the settings mean
- Angle: 0° points up, 90° to the right, 180° down. CSS angles go clockwise.
- Radial size:
farthest-corner(default) makes the last stop reach the farthest corner;closest-sidemakes a tight spot that ends at the nearest edge. - Positions: percentages along the gradient line (or around the circle for conic). Stops are written in position order; two stops at the same position give a hard edge.
- Repeating: the pattern between the first and last stop is tiled. Use small ranges (for example 0–10%) or the result looks the same as a normal gradient.
- Opacity: stops below 100% are written as
rgba(), so the gradient can sit on top of an image or another background.
Limitations
Positions are whole percentages and the editor supports up to ten stops; you can fine-tune the copied CSS by hand if you need pixel positions or more stops. Colours are interpolated by the browser in sRGB, so blends between complementary colours (blue to yellow, for example) may pass through a dull grey; adding a middle stop with a brighter colour avoids that. The fallback colour is a simple average and is not meant to match any single point of the gradient.
Tips
- For text over a gradient, check that the text colour passes contrast at both ends with the contrast checker.
- Build a palette first with the colour palette generator, then use two neighbouring shades for a subtle gradient.
- Gradient text: apply the gradient as a background and add
background-clip: textwithcolor: transparent.
Frequently Asked Questions
What is the difference between linear, radial and conic gradients?
A linear gradient changes colour along a straight line at a given angle. A radial gradient spreads out from a centre point as a circle or ellipse, and a conic gradient sweeps colours around a centre point like the hands of a clock.
Why does the CSS include a background-color?
It is a solid fallback, the average of your stop colours, shown if the gradient fails to render and while the page is loading in some contexts. Untick "Solid fallback colour" if you do not want it.
How do I make hard stripes instead of a smooth blend?
Give two neighbouring stops the same position, for example blue 0% and blue 5%, then light blue 5% and light blue 10%, and tick Repeating. The "Stripes" preset does exactly that.
How do I fade an image or colour to transparent?
Lower the Opacity of one stop to 0%. The tool writes that stop as rgba() with alpha 0 using the same colour, which avoids the grey band you can get with the keyword transparent in some older browsers.
Can I use the output with Tailwind CSS?
Yes. Paste the value into an arbitrary property such as bg-[linear-gradient(90deg,#667eea_0%,#764ba2_100%)] (spaces replaced by underscores) or into your own CSS file; Tailwind's built-in bg-gradient utilities only cover simple linear cases.
Is anything uploaded?
No. The gradient is generated as a CSS string in your browser and nothing is sent to a server.
Related tools
- Color ConverterConvert colors between HEX, RGB, HSL and HSV formats
- Color Contrast CheckerCheck WCAG 2.1 color contrast ratio between foreground and background colors. Shows AA/AAA pass/fail for normal and large text. Essential for accessible design.
- CSS Shadow GeneratorGenerate CSS box-shadow and text-shadow visually with live preview. Adjust offset, blur, spread, color, and opacity. Copy ready-to-use CSS code.
- Random Color GeneratorGenerate random colors with live preview. Lock individual channels, copy HEX/RGB/HSL values, and generate multiple colors at once for palettes.
- Color Palette ExtractorUpload an image and extract its dominant color palette in HEX, RGB, and HSL formats.
All Color & Design tools · Found a bug or a wrong result? Report it.