CSS Gradient Generator

Build a CSS gradient visually and copy the code.

Color Tools Free, no sign-up Runs in your browser

CSS Gradient Generator tool

Colour stops

CSS

About the CSS Gradient Generator

CSS Gradient Generator lets you build a gradient by eye and copy the code when it looks right. Choose linear or radial, set the angle or shape, and add as many colour stops as you need. The preview fills a large area so you see the gradient at a realistic size rather than in a thumbnail.

Each stop has a colour and a position as a percentage, both adjustable. Adding a third or fourth stop is where gradients stop looking like a default and start looking designed, because the transition can be weighted toward one end rather than passing evenly through the middle.

The generated CSS is shown ready to paste, as a complete background property. A random button produces a fresh combination when you are stuck, and the whole thing can be reversed in one click, which is often the fastest way to find out whether a gradient reads better running the other way.

How to use the CSS Gradient Generator

  1. Choose a gradient typeLinear with an angle, or radial with a shape.
  2. Set your colour stopsAdjust the colour and position of each, and add or remove stops as needed.
  3. Watch the previewThe large preview updates as you change anything.
  4. Copy the CSSThe complete background property is shown ready to paste.

Features

  • Linear gradients with any angle, and radial gradients
  • Two or more colour stops, each with its own position
  • Add, remove and reorder stops
  • Large live preview
  • Reverse the gradient in one click
  • Random gradient button
  • Copies a complete, valid CSS background property

Who uses this tool

The css gradient generator is used by writers, developers, students, marketers and anyone else who needs the job done once without installing software. Common cases include:

  • Designing a hero background for a page
  • Creating a subtle gradient for a button or card
  • Building a colourful placeholder image in CSS
  • Exploring colour combinations quickly
  • Producing a gradient that matches a brand palette

Frequently asked questions

What does the angle mean in a linear gradient?

It is the direction the gradient travels, measured in degrees with 0 pointing upward and 90 pointing to the right. So 180 degrees runs top to bottom, which is the most common choice for a page background.

How many colour stops should I use?

Two is the default and often enough. Three or four allow a more controlled transition, where most of the gradient sits in one colour and shifts late. Too many stops usually looks muddy.

Do gradients work everywhere?

Linear and radial gradients are supported by every browser in current use. Only very old browsers need a fallback, which is normally just a solid background colour declared before the gradient.

Why does my gradient look banded?

Banding happens when two colours are close in tone and the display cannot render enough intermediate steps. Using colours with more difference in lightness, or adding a subtle texture over the top, usually removes it.

Can I use a gradient on text?

Yes, by applying the gradient as a background and clipping it to the text. That is a separate technique from what this tool generates, though you can paste the gradient value into it.

Does the generated CSS include vendor prefixes?

No, because they are no longer needed. Every browser in current use supports the unprefixed syntax, and prefixes just make the code longer.

If the css gradient generator is not quite what you need, these other free tools solve closely related problems.

Color Picker

Choose any colour and copy it in HEX, RGB or HSL, with tints and shades.

Color Tools Use tool

Color Contrast Checker

Measure contrast between two colours and see which accessibility levels pass.

Color Tools Use tool

HEX to RGB Converter

Turn any HEX code into RGB and HSL values, with alpha support.

Color Tools Use tool

RGB to HEX Converter

Enter R, G and B values and get the matching HEX and HSL colour.

Color Tools Use tool