# CSS Gradient Generator

> The CSS Gradient Generator builds linear-gradient, radial-gradient and conic-gradient code with as many colour stops as you like, shows a live preview and copies the CSS for you.

URL: https://atechcraft.com/css-gradient-generator/
Category: Image Tools
Last updated: 2026-12-01
Author: Abdul Moid Khan, ATechCraft

Runs in your browser. Your data never leaves your device.

## How to use the CSS Gradient Generator

1. Choose the gradient type: linear, radial or conic.
2. Set the angle and edit, add or remove colour stops.
3. Try a preset for a quick start.
4. Copy the CSS and paste it into your stylesheet.

## What is a CSS gradient generator?

A CSS gradient generator builds the code for a smooth blend between colours that you can use as a background on any web page. This one creates the three CSS gradient types (linear, radial and conic), supports any number of colour stops, shows a live preview and copies ready-to-paste CSS, including a fallback colour and a Tailwind class.

Gradients replace background images in many designs. They are just text, so they add almost nothing to page weight and stay sharp on every screen.

## How do CSS gradients work?

A gradient is a CSS *image* generated by the browser. You give it a direction or shape and a list of colour stops ([MDN: Using CSS gradients](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_images/Using_CSS_gradients)).

- **`linear-gradient(angle, stops)`** blends along a straight line. `0deg` goes upward, `90deg` to the right, `180deg` downward.
- **`radial-gradient(circle, stops)`** blends outward from the centre in rings.
- **`conic-gradient(from angle, stops)`** blends around the centre like the hands of a clock. It is handy for pie charts and colour wheels.

Each **colour stop** is a colour plus a position from 0% to 100%. Between two stops, the browser blends the colours evenly. If two stops share the same position, you get a hard line instead of a blend, which is how stripes are made.

The generated code puts a plain `background` colour first and the gradient second. Very old browsers that do not understand gradients simply use the plain colour.

## Worked example

You want a header that fades from deep green on the left to mint on the right.

1. Choose **Linear** and set the angle to **90°**.
2. Set stop 1 to `#0f6957` at 0% and stop 2 to `#78d8ba` at 100%.
3. The tool outputs:

```css
background: #0f6957;
background: linear-gradient(90deg, #0f6957 0%, #78d8ba 100%);
```

Move stop 2 to 60% and the mint colour is reached earlier, leaving the right 40% solid mint. Add a third stop of `#ffffff` at 100% and the header ends in white.

## Gradient types compared

| Type | Shape | Good for | Main setting |
| --- | --- | --- | --- |
| Linear | Straight band | Headers, buttons, page backgrounds | Angle |
| Radial | Circles from the centre | Spotlights, glows, soft vignettes | Shape and centre |
| Conic | Sweep around a point | Pie charts, colour wheels, loading rings | Start angle |

## Tips for good-looking gradients

1. **Use colours that are close on the colour wheel** for smooth blends. Blending opposites like red and green passes through a muddy grey in the middle.
2. **Add a middle stop** when a blend looks dull. A slightly brighter mid-colour keeps it vivid.
3. **Keep text readable.** Check your text colour against the darkest and lightest parts of the gradient with the [Color Palette Generator](https://atechcraft.com/color-palette-generator/).
4. **Borrow colours from your brand or photos** with the [Color Picker from Image](https://atechcraft.com/color-picker-from-image/).
5. **Pair a gradient card with a soft shadow** from the [Box Shadow Generator](https://atechcraft.com/box-shadow-generator/).
6. If your stylesheet grows large, shrink it with the [Code Minifier](https://atechcraft.com/code-minifier/).

## Limitations

- **Banding:** long, subtle gradients across large screens can show visible steps because screens have limited colour levels. Adding a tiny amount of noise in a design tool, or using a shorter blend, helps.
- **Radial options are simplified.** This tool uses a centred circle. CSS also supports ellipses, custom sizes and off-centre positions, which you can add by hand (for example `radial-gradient(circle at 20% 30%, ...)`).
- **Interpolation colour space:** browsers blend in sRGB by default. Newer CSS lets you choose spaces like `oklch` for smoother blends, which this tool does not add.
- **Tailwind class** uses an arbitrary value; very long gradients are easier to manage in a CSS file.

## Key terms

- **Colour stop:** a colour at a set point along the gradient.
- **Angle:** the direction of a linear gradient, in degrees.
- **Fallback:** a simpler style used when a browser does not support the main one.

## Frequently asked questions

### Do CSS gradients work in all browsers?

Linear and radial gradients work in every current browser. Conic gradients are supported in all major current browsers too.

### Are gradients better than images?

Usually, yes. A CSS gradient is a few bytes of text, scales to any size and needs no extra download.

### What do the stop percentages mean?

Each stop says where along the gradient its colour is fully reached. 0% is the start and 100% is the end.

### How do I keep text readable on a gradient?

Check the contrast of your text against both the lightest and darkest part of the gradient with the Color Palette Generator.
