CSS Gradient Generator

Build a linear or radial gradient visually and copy the CSS as you edit.

✓ Free to use · Runs in your browser · No sign-up

Choose your colors. See the gradient live.

The preview updates as you make changes. Everything is created in this browser. Your entries are not uploaded.

90° runs from left to right; 180° runs from top to bottom.

A color stop tells the gradient which color to reach at a point. 0% is the start; 100% is the end. Stops are sorted by position automatically.

Color stop 1
#24745A
0–100. Matching positions create a sharp color edge.
Color stop 2
#DAE8BA
0–100. Matching positions create a sharp color edge.

Live gradient preview

Copy this declaration into the CSS rule for the element you want to style.

How to use CSS Gradient Generator

  1. Choose a linear gradient for a direction, or a radial gradient for colors spreading from a center.
  2. Pick colors and their positions. Add up to eight stops, adjust the angle or center, and watch the preview.
  3. Copy the generated background declaration into your CSS, or download it as a CSS file.

A closer look

A gradient blends colors between stops along a direction or away from a center. Stop positions run from 0% to 100% and are sorted before generating CSS. Two stops at the same position make a sharp boundary. For linear gradients, 90 degrees runs left to right and 180 degrees runs top to bottom. Radial gradients use a circle or ellipse and a center position relative to the element. The generated declaration is ready to place inside an existing CSS rule.

A practical example

Place green at 0% and yellow at 100%, then choose 90° for a left-to-right blend. Copy the background declaration into an existing CSS rule.

A useful tip

The preview is one rectangular shape. A radial gradient’s appearance can change on an element with a different size or aspect ratio. Check text contrast wherever the gradient is used as a background.

Good questions. Simple answers.

Does Copy CSS include a selector?

No. It copies a background declaration, such as background: linear-gradient(...);. Put it inside the rule for your own element.

What does Random colors change?

It replaces stop colors while keeping your current type, positions, angle, and radial center. Reset restores the original two-stop example.

Explore all generators for related tasks and category-specific guidance, or read how Toolzafi handles your data.

A few more useful tools