CSS Gradient Generator

Blend two or more colours into a linear, radial or conic gradient and copy the CSS. Set the angle or centre, add up to ten colour stops and move them, or turn on repeating to make stripes and rings. The preview updates as you go, and the code comes as plain CSS or a Tailwind class.

Presets
Type
Colour stops
Code
background: #F97316;
background: linear-gradient(135deg, #F97316 0%, #DB2777 100%);

The first line is a plain colour for very old browsers.

Generating runs in your browser. What you type never leaves this device.

Features

  • Linear, radial (circle or ellipse) and conic gradients

  • Two to ten colour stops with positions; new stops take the colour already at that spot

  • Repeating gradients for stripes, rings and sunbursts

  • Presets including sunset, ocean, mango, tiranga, spotlight and a colour wheel

  • CSS with a solid-colour fallback line, or a Tailwind bg-[...] class

  • Accepts HEX, rgb(), hsl() and oklch() colours, with transparency

Where gradients are used

Hero sections and banners

A soft two-colour gradient behind a headline looks modern without needing an image file.

Buttons and badges

A subtle diagonal gradient gives buttons depth; copy the CSS straight into your stylesheet.

Charts and loaders

Conic gradients draw pie charts, progress rings and colour wheels in pure CSS.

Gradient basics

Linear, radial or conic?

  • Linear: colours change along a straight line. 90deg goes left to right, 180deg top to bottom, 135deg top-left to bottom-right.
  • Radial: colours spread out from a centre point in a circle or an ellipse.
  • Conic: colours sweep around a centre point, like the hands of a clock. Good for pie charts and colour wheels.

Colour stops

Each stop is a colour at a position from 0% to 100%. Two stops at the same position make a hard edge instead of a blend, which is how stripes are made. Colours with transparency (for example #00000000) fade the gradient into whatever is behind it.

Avoiding muddy middles

Blending two very different colours, such as blue and yellow, can pass through a dull grey in the middle. Add a third stop with a bright in-between colour, or pick colours closer on the colour wheel.

Related tools

CSS Gradient Generator - FAQ