A good gradient is more than two colors and an angle. Mix two saturated colors in a plain CSS gradient and the middle often turns grey; a big hero background shows visible bands; and the gradients designers love today are layered, softly blended, a little grainy and tested on real content. This free CSS gradient generator handles all of that visually, with a live preview, and gives you clean CSS — or a PNG or SVG image — in one click.
Linear, radial and conic gradients
Pick a type in the Type section. Linear gradients run along a line at any angle: drag the angle dial, use the slider, click one of the angle chips, or focus the dial and use the arrow keys. Radial gradients spread out from a center point: choose an ellipse or circle, pick a size keyword (farthest-corner, closest-side, farthest-side or closest-corner) and set the center with the X/Y sliders or by dragging directly on the preview. Conic gradients sweep around a center like a clock face, with their own start-angle dial and draggable center.
Color stops, opacity and the gradient bar
Each color stop appears as a handle on the gradient bar above the preview. Click the bar to add a stop — its color and opacity are worked out from the gradient at that exact point, so it blends in. Drag handles to move them, or select one and use the ← → keys (hold Shift for bigger steps); Delete removes it. In the Color stops list, set each stop's color with the picker or a hex code, its opacity from 0 to 100%, and its exact position. Opacity is what makes layers possible: fade a stop to 0% and whatever is underneath shows through.
Smooth gradients: OKLCH color spaces and easing
By default, browsers mix gradient colors in sRGB, and a blue-to-yellow or red-to-green gradient passes through a dull, greyish middle. The Smoothness section fixes it. Choose OKLab for a perceptually even blend, OKLCH to keep colors vivid by travelling around the hue wheel, OKLCH long hue to go the long way round for rainbow sweeps, or HSL. The exported CSS uses the modern syntax — for example linear-gradient(in oklch 135deg, …) — and adds an sRGB fallback line first, so older browsers still get a gradient.
Turn on Eased gradient to add ease-in-out in-between stops to every segment. Instead of changing color at a constant rate and leaving a visible seam at each stop, the gradient starts and ends gently — the technique behind smooth image overlays and soft hero backgrounds.
Layers, blend modes and mesh-style gradients
Click + Layer to stack another gradient on top. Each layer has its own type, stops, angle, center and blend mode (screen, overlay, multiply, soft-light and more), and the arrows reorder them. Stack a few soft radial "glows" over a dark linear base and you have a mesh-style background in pure CSS — the Aurora mesh, Spotlight and Peach glow presets show how. The export lists every layer in one background declaration, top layer first, with a matching background-blend-mode.
Grainy gradients
The Grain slider adds a film-grain texture over the whole gradient. It is a tiny inline SVG noise image (feTurbulence) blended with overlay, so it needs no image file, scales to any size and also hides banding on large, subtle gradients — the popular "grainy gradient" look.
Stripes, rings and pie charts
Turn on Hard stops to make each color a solid band, and Repeating to repeat the pattern every so many pixels (or degrees for conic gradients). That covers candy stripes and progress-bar stripes (repeating-linear-gradient), ripples and rings (repeating-radial-gradient) and pie charts (conic-gradient with hard stops).
Real-world previews and a contrast check
Above the preview, switch between Background, Hero, Card, Buttons, Text and Border. Hero shows the gradient behind a landing-page heading and buttons; Card uses it as card artwork, avatars and a badge; Buttons shows filled, pill, outline and icon buttons; Text clips it to type with background-clip: text; Border draws a gradient outline that keeps its rounded corners. In the Hero, Buttons and Border views, the tool samples the rendered gradient, measures the worst-case WCAG contrast of white and dark text across it, picks the more readable color and shows the ratio with an AA badge.
Animated gradients
Six animation presets — Slide, Diagonal, Hue Shift, Breathe, Pulse and Spin — play live in the preview, with a speed control from 1 to 12 seconds. The CSS export includes the complete @keyframes block. Spin animates the top linear layer's angle through a registered @property.
Export the code, download an image, share or fork
Choose CSS, Tailwind, SCSS, CSS Variable or React above the code and click Copy; the CSS adapts to the preview you are on (a .gradient-text rule for Text, a .gradient-border rule for Border, and so on). Pick a size and click PNG or SVG to download an image — 1920×1080 and 2560×1440 wallpapers, a 1200×630 social image, a square or a story — drawn by the tool itself with layers, opacity, blend modes and grain included. Share link copies a URL that reopens the exact gradient, and Fork & Edit opens it on a ready-made hero page in My Code so you can keep building. Everything auto-saves in your browser and runs entirely on your device.