Design Tool

Free CSS Gradient Generator

Build linear, radial and conic gradients visually. Drag colour stops, rotate the angle dial, load presets and copy production-ready CSS in seconds.

Live preview 100% offline 3 gradient types Copy-ready CSS
Live preview
Drag stops to adjust Β· Click bar to add Β· Del to remove
Position on gradient (0% β†’ 100%)

Controls

Angle
135Β°
deg
Presets
Actions

Colour stops

styles.css
background: linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);

About CSS Gradients

A CSS gradient is a smooth transition between two or more colours, written as a CSS function like linear-gradient(), radial-gradient() or conic-gradient(). Because gradients are technically background images, they work anywhere background-image is allowed and scale perfectly on any screen without pixelation. They replaced the old bitmap-heavy technique of slicing gradient images and are one of the most-used features in modern web design.

This generator lets you build all three gradient types visually. You can drag colour stops along the gradient bar, tweak the angle with a rotating dial, adjust stop positions with precision, and copy the finished CSS with a single click.

The three gradient types

TypeBlends along…Typical use
LinearA straight line at any angleButtons, headers, hero backgrounds, chart fills
RadialCircles/ellipses from a centre pointSpotlights, soft highlights, card backgrounds
ConicA sweep around a central axisPie charts, colour wheels, retro dashboards

Colour stops: how gradients get their shape

Every gradient is defined by a set of colour stops. Each stop has a colour and a position from 0% to 100%. The browser interpolates smoothly between adjacent stops, so:

The angle convention

In linear-gradient(), the angle points in the direction the gradient travels:

AngleDirection
0degBottom β†’ Top (colour 1 at the bottom)
90degLeft β†’ Right
135degTop-left β†’ Bottom-right (diagonal, most popular)
180degTop β†’ Bottom (default, if you omit the angle)
270degRight β†’ Left

Practical tips

Common use cases

Hero backgrounds

Large atmospheric gradients behind landing copy.

Buttons & CTAs

Subtle gradients add depth without a lot of markup.

Image overlays

Darken photo edges for readable text.

Chart fills

Gradient area fills under line charts.

Cards & badges

Diagonal gradients on pills and status chips.

App splash screens

Full-viewport colour fades on mobile entry screens.

Privacy and accuracy

This CSS gradient generator runs entirely in your browser. All generation happens locally in JavaScript with no server calls. The colours and settings you use are never transmitted, stored or logged.

Frequently Asked Questions

What is a CSS gradient?
A CSS gradient is a smooth transition between two or more colours, written as a CSS function like linear-gradient(), radial-gradient() or conic-gradient(). Gradients are images, so they can be used anywhere a background-image is allowed. They are resolution-independent β€” they scale perfectly on any screen without raster artifacts.
What is the difference between linear, radial and conic gradients?
Linear gradients blend colours along a straight line at any angle. Radial gradients blend outwards from a centre point in a circle or ellipse, like a spotlight. Conic gradients sweep colours around a central axis like a pie chart, going through 360 degrees. Each is best for different visual effects.
How do gradient colour stops work?
Each stop has a colour and a position from 0% to 100%. The browser interpolates smoothly between adjacent stops. Two stops give a simple two-colour fade. Three or more stops let you create multi-colour transitions, sharp mid-tones or banded effects β€” for example, placing two stops at the same position creates a hard colour break.
What does the angle control do in a linear gradient?
The angle sets the direction the gradient runs. 0deg points upward (colour stops at the bottom, ends at the top), 90deg points right, 180deg points down and 270deg points left. Any angle between 0 and 360 works β€” 135deg is a popular diagonal that reads as "top-left to bottom-right".
Can I animate or transition CSS gradients?
CSS gradients themselves cannot be transitioned smoothly, but you can animate them via custom properties with @property, or by cross-fading two stacked gradient layers with opacity. For simple fades, the @property method on the gradient variable is the modern approach.
Are gradients accessible?
Gradients are fine for decorative backgrounds, but if you place text on top of a gradient, remember the background colour varies across the surface. The text must meet WCAG contrast against the lightest and darkest parts of the gradient. Check both ends with a contrast checker before shipping.
How many colour stops can I add?
This tool supports up to twelve stops. In practice most designs use two to five. More stops produce smoother or more complex colour transitions but quickly become hard to control by hand.
Is this CSS gradient generator free?
Yes, it is 100% free, requires no sign-up and runs entirely in your browser. No length limits, no watermarks, no premium tier.

Related Colour Tools

Done!