CSS Gradient Generator

Build linear, radial, and conic CSS gradients with a live preview — perfect for backgrounds, buttons, and gradient text. Drag color stops on the gradient bar, fine-tune opacity and position, start from a preset, then copy the CSS, Tailwind, or HTML when you're done.

Presets:

Gradient type

How colors are projected across the element.

Direction

degrees

Quick directions

Shape

Size

Position

From angle

Position

Color stops

Click a stop to edit it. Drag the handles on the gradient bar to reposition. Max 10 stops.

Editing stop

Color

Opacity

Position

Live Preview
Gradient

Click the bar to add a stop · drag a handle to move it · double-click a handle to remove it.

Gradient functions

linear-gradient()
Straight-line blend along an angle
radial-gradient()
Blend outward from a center
conic-gradient()
Blend rotated around a center
repeating-*-gradient()
Tiles the stop pattern

Direction & angle

0deg
to top
90deg
to right
180deg
to bottom
270deg
to left

Color stops

#f00 0%
Color + position
#f00 0%, #f00 50%
Hard stripe (no blend)
rgba(0,0,0,0)
Fade to transparent
red, orange, gold
Auto-spaced stops

Common patterns

Gradient text
background-clip: text
Image overlay
linear-gradient + url()
Pie chart
conic + hard stops
Spotlight
radial closest-side

Frequently asked questions

A linear-gradient blends colors along a straight line in a direction you set with an angle (90deg) or keyword (to right). A radial-gradient blends outward from a center point in a circle or ellipse, like a spotlight. A conic-gradient sweeps colors around a center point like the hands of a clock — making it the right choice for pie charts, color wheels, and loading spinners. All three accept the same color-stop syntax.
Add more color stops, separated by commas. Each stop is a color followed by an optional position percentage, e.g. linear-gradient(90deg, #6366f1 0%, #ec4899 50%, #f97316 100%). The browser blends smoothly between adjacent stops. There is no limit on the number of stops, and you can place two stops at the same position to create a hard color stripe instead of a blend. In this tool, just click the gradient bar to drop in another stop.
The angle sets the direction the gradient progresses. 0deg points to the top, 90deg to the right, 180deg to the bottom, and 270deg to the left — angles increase clockwise. The keyword equivalents are to top, to right, to bottom, and to left. For rectangular boxes the keyword matches the angle, but corner keywords like to top right always aim exactly at the corner regardless of aspect ratio, which a fixed angle does not.
Lower a color stop's opacity so it is emitted as an rgba() or hsla() value. A common pattern is fading an image overlay to nothing: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0)). Note that in Safari the bare transparent keyword means transparent black, which can tint a colored fade grey — fade to an explicit rgba() of the same color with alpha 0 instead. Set any stop's Opacity slider below 100% to do this here.
A conic-gradient rotates colors around a center point, which makes it ideal for pie and donut charts, color pickers and hue wheels, percentage and progress rings, and angular glow effects. Set the starting angle with from Ndeg and the center with at position. Placing stops at hard boundaries (e.g. #f00 0deg 25%, #0f0 25% 50%) produces crisp pie slices with no blending.
Set the gradient as background-image on the text element, then clip the background to the text and make the fill transparent: -webkit-background-clip: text; background-clip: text; color: transparent. The -webkit- prefix is still required in Safari and Chrome. Toggle the Text preview above to see your gradient applied to type before you copy it.
Tailwind ships utilities like bg-gradient-to-r with from-/via-/to- stops for simple cases. For full control — custom angles, conic gradients, precise positions, or opacity — use an arbitrary value: bg-[linear-gradient(90deg,#6366f1_0%,#ec4899_100%)], writing spaces as underscores. The Tailwind tab above outputs the ready-to-paste class for the exact gradient you've built.
Linear and radial gradients are supported in every modern browser without prefixes and have been baseline available for years. Conic gradients reached baseline support across Chrome, Firefox, Safari, and Edge in 2021, so they're safe for current browsers but may want a fallback background-color for very old ones. Gradients are pure CSS — there's no image request and they scale to any size without losing quality.