Skip to content
Toolzent

CSS Gradient Generator

Create CSS gradients visually and copy the code. Pick two colors, choose linear or radial, set the angle, and get ready-to-use CSS. Free online gradient maker.

Updated 2026-06-14 · Free · No sign-up · Runs privately in your browser

Build a CSS Gradient Visually

The CSS gradient generator lets you design a gradient by eye and copy ready-to-use CSS. Pick two colors, choose linear or radial, set the angle, and grab the code — no syntax to memorize.

How to Use It

  1. Choose Color 1 and Color 2 with the swatches.
  2. Pick a type: Linear or Radial.
  3. For linear, drag the angle slider to aim the gradient.
  4. Tap Random for a surprise combo or Swap colors to reverse it.
  5. Tap the CSS box to copy the code.

Understanding the Output

The tool generates standard CSS like:

background: linear-gradient(90deg, #7C3AED, #EC4899);

Paste it into the background property of any element — a div, header, button or section — and it renders in every modern browser.

Linear vs Radial

TypeHow it blendsExample use
LinearAlong a straight line at an angleHero sections, buttons, banners
RadialOutward in a circle from the centerSpotlights, glows, cards

Angle Quick Reference

AngleDirection
0degBottom to top
90degLeft to right
180degTop to bottom
45degBottom-left to top-right

Tips for Great Gradients

  • Keep hues close for a smooth, subtle blend; contrast them for a bold, energetic look.
  • Use a 45deg or 135deg angle for a natural, dynamic feel on hero backgrounds.
  • Radial gradients work beautifully behind centered content to draw the eye inward.
  • Hit Random a few times to discover combinations you would not have picked by hand.

Everything updates live in your browser, so you can experiment freely and copy the exact CSS the moment a gradient looks right. It is the fastest way to go from idea to working background code.

Frequently asked questions

How do I create a CSS gradient?+

Pick two colors, choose linear or radial, and set the angle for linear gradients. The tool shows a live preview and generates the CSS, such as background: linear-gradient(90deg, #7C3AED, #EC4899); which you can copy with one tap.

What is the difference between linear and radial gradients?+

A linear gradient blends colors along a straight line at a chosen angle, while a radial gradient blends them outward in a circle from the center. Both are supported here with a live preview.

How does the gradient angle work?+

The angle sets the direction of a linear gradient in degrees. 0 degrees goes bottom to top, 90 degrees goes left to right, and 180 degrees goes top to bottom. Drag the slider to see the direction change live.

How do I use the generated CSS?+

Copy the generated line and paste it into the background property of any element in your stylesheet, for example a div, header or button. The gradient will render in all modern browsers.

Can I generate a random gradient?+

Yes. Tap Random to get two random colors and a random angle instantly, or use Swap colors to reverse the gradient direction. It is a fast way to find a combination you like.