CSS Gradient Generator

Choose a type, set the colours, and watch the gradient change. When it looks right, copy the one line of CSS.

Free, no sign-up. Everything runs in your browser.

Gradient settings

Used by linear and conic gradients. 0 is up, 90 is right.

Optional. Default 0.

Optional. Default 100, or 50 with three colours.

Optional. Default 100.

Set your colours to see the gradient.

How to

Make a gradient in three steps

  1. Choose the type

    Linear runs in a straight line at an angle, radial spreads out from the centre and conic sweeps around it like a colour wheel.

  2. Set the colours

    Pick two colours, or tick the box for a third. Change the positions if you want a colour to take up more or less of the gradient.

  3. Copy the CSS

    Press Copy and paste the declaration into your stylesheet as the background of any element.

Gradients that look good

  • Pick colours that are close on the colour wheel for a smooth look. Opposite colours can turn muddy in the middle.
  • Put text on a gradient only after checking its contrast at the lightest and darkest points of the background.
  • Use a solid background colour as a fallback line before the gradient for very old browsers.
  • Keep angles to multiples of 45 for a clean, intentional feel.

FAQ

Gradient generator questions

What is the difference between linear, radial and conic gradients?

A linear gradient blends colours along a straight line, a radial gradient blends outwards from a centre point, and a conic gradient sweeps colours around a centre point, like the slices of a pie.

How does the angle work?

In a linear gradient, 0 degrees points up and the angle increases clockwise, so 90 degrees runs left to right and 180 runs top to bottom. In a conic gradient it sets where the sweep starts.

How do colour positions work?

Each colour starts at its percentage along the gradient. By default two colours sit at 0% and 100%, and three at 0%, 50% and 100%. Positions must increase from first to last.

Where do I paste the CSS?

Add the line to a rule for the element, for example .hero { background: linear-gradient(…); }. It works on any element that can have a background.

Do all browsers support conic gradients?

Current versions of the major browsers do. Add a plain background-color line before it as a fallback for anything older.

Is anything sent to a server?

No. The gradient is built in your browser.