CSS Gradient Generator

Choose two colors, a type and an angle to build a CSS gradient with a live preview, then copy the ready-to-use background rule. Everything updates instantly in your browser.

Pick colors and a type to build a gradient.

Gradient CSS syntax

A CSS gradient is an image you set on background. A linear gradient blends colors along a line at a given angle; a radial gradient blends outward from a center point.

background: linear-gradient(135deg, #2563eb, #7c3aed);

The angle 0deg points up, 90deg points right, and so on. Each color is a stop; with two stops the colors blend evenly across the box. This tool writes that rule for you and previews it live.

Worked example

A blue-to-purple diagonal:

Colors: #2563eb → #7c3aed.
Angle: 135° (top-left to bottom-right).
CSS: background:linear-gradient(135deg,#2563eb,#7c3aed);

Tips and browser support

CSS gradients are widely supported in all modern browsers and need no images, so they're crisp at any size and fast to load. For a radial gradient the angle doesn't apply; the blend radiates from the center. You can add more color stops in your CSS for richer effects, and pair a gradient with background-attachment or text-clipping for headers and buttons.

Tip: want a coordinated two-color pair to start from? Use the color palette generator.

Frequently asked questions

What's the difference between linear and radial?

A linear gradient blends colors along a straight line at the angle you set; a radial gradient blends outward in circles from a center point. The angle only affects linear gradients.

How does the angle work?

In CSS, 0deg points to the top and the angle increases clockwise: 90deg is to the right, 180deg down, 270deg left. So 135deg runs from the top-left toward the bottom-right.

Do gradients work in all browsers?

Yes. Linear and radial gradients are supported in every modern browser without prefixes, and because they're rendered, not images, they stay sharp at any size.

Is the CSS generated locally?

Yes. The preview and CSS are built in your browser as you adjust the controls. Nothing is uploaded.

MB
Mustafa Bilgic · Editor, Calcool
Generates standard CSS linear-gradient() / radial-gradient() rules with a live preview. Widely supported with no prefixes. Everything runs in your browser — nothing you enter is uploaded, logged or stored.

Related calculators