CSS Gradient Generator
The syntax, piece by piece
A linear gradient is one CSS function: background: linear-gradient(90deg, #2563eb, #06b6d4); The first argument is the direction — an angle, or a keyword like to right — and the rest are colour stops. Angles in CSS gradients start at the top and run clockwise: 0deg points up (toward the top), 90deg points right, 180deg down, 270deg left — the opposite convention to mathematics, and the cause of most “my gradient goes the wrong way” moments. Colour stops can carry positions: #2563eb 0%, #06b6d4 55%, #a855f7 100% places the middle colour just past centre; without positions the browser spaces stops evenly, which is what this generator does with two stops (0%, 100%) or three (0%, 50%, 100%). Set two stops to the same position and the blend becomes a hard edge — the trick behind striped patterns, two-tone backgrounds and progress-bar fills built from a single gradient.
Radial gradients radiate from a centre point: radial-gradient(circle, #06b6d4, #2563eb) — a glow rather than a sweep. They suit spotlight effects, vignettes and buttons; their stops behave identically, only the geometry differs. Both types layer: CSS allows several backgrounds on one element, so a radial highlight over a linear base is a single declaration with two functions — the standard recipe for the soft, lit-from-above surfaces of modern interfaces.
A third sibling deserves a mention: the conic gradient, which sweeps colours around a centre point like a pie chart — conic-gradient(#2563eb 0 25%, #06b6d4 0) draws a quarter-filled disc, and conic gradients power most pure-CSS pie charts and many colour-wheel pickers. This generator covers the two workhorse types; once the stop-and-position logic clicks here, conic syntax reads as the same idea bent into a circle. Performance, briefly: gradients are painted by the browser’s compositor and are effectively free at page scale — cheaper than an image of the same blend in bytes, in requests and in scaling behaviour, which is why a gradient should always be CSS rather than a downloaded picture.
Designing gradients that do not look cheap
Three habits separate tasteful gradients from screensaver flashbacks. Blend neighbours, not strangers: colours adjacent on the wheel (blue → cyan, orange → pink) blend through pleasing midpoints, while distant pairs (red → green) pass through muddy browns and greys in the middle — if you must cross the wheel, add a deliberate middle stop, as the three-colour mode here allows, and choose the midpoint yourself. Mind the middle: a straight RGB blend between two saturated colours often greys at the centre; nudging the middle stop’s lightness up, or choosing a midpoint hue along the short arc of the wheel, keeps it luminous. Use gradients sparingly and softly: the contemporary look is a subtle shift (10–20% lightness) across large surfaces, reserving saturated sweeps for heroes, charts and brand moments. And a functional warning: text over a gradient needs its contrast checked at the worst point of the blend, not the average — the lightest patch behind your text is the one that decides legibility. When a gradient must carry text, a semi-transparent dark overlay layer between them is the reliable professional fix. When in doubt, squint at the design from arm’s length: a good gradient survives the squint test, reading as light and depth rather than as decoration competing with the content for attention.
Frequently asked questions
How do I make a gradient go diagonally?
Set the angle between the cardinal points: 45deg runs from bottom-left to top-right, 135deg from top-left to bottom-right. Or use the keyword form — linear-gradient(to top right, …) — which aims at the corner exactly and adjusts to the box’s proportions, whereas a fixed 45deg only hits the corner on a square element. This generator takes a numeric angle (0–360) so you can dial any direction; remember CSS angles start at the top and increase clockwise, so 90deg is left-to-right.
How do I add a third color to a CSS gradient?
Just add another colour stop: linear-gradient(90deg, #2563eb, #a855f7, #06b6d4) blends through purple in the middle. Without positions, stops space evenly (0%, 50%, 100% for three). Add positions to control the balance — #2563eb 0%, #a855f7 30%, #06b6d4 100% gives purple a brief appearance early. Three stops is also the fix for muddy two-colour blends: pick the midpoint colour yourself instead of accepting whatever RGB interpolation produces halfway between distant hues.
What is the difference between linear and radial gradients?
Geometry. A linear gradient transitions along a straight line at your chosen angle — colour bands are straight and parallel. A radial gradient transitions outward from a centre point in circles (or ellipses), like a glow or a ripple. Linear suits page backgrounds, buttons and bars; radial suits spotlights, vignettes, avatar placeholders and anything meant to look lit. Both accept the same colour stops, and they can be layered on one element as multiple backgrounds.
How do I make a hard stripe instead of a smooth blend?
Give two stops the same position: linear-gradient(90deg, #2563eb 0%, #2563eb 50%, #06b6d4 50%, #06b6d4 100%) produces two solid halves with a knife-edge between them. Repeat the pattern at small intervals and you get stripes; combine with background-size and the stripes tile — the classic pure-CSS barber pole and hazard pattern. This generator spaces stops evenly for smooth blends; for stripes, generate the two-colour version and edit the positions in the output, as shown here.
Do CSS gradients need vendor prefixes or fallbacks?
Not any more. The unprefixed linear-gradient and radial-gradient syntax is supported by every browser in meaningful use (the prefixed -webkit- era ended over a decade ago). The one fallback worth keeping is a solid background-color declared before the gradient, for ancient clients and for the moment before CSS loads: background: #2563eb; background: linear-gradient(…). If the gradient fails, the solid colour carries the design — choose it as the gradient’s dominant or average colour.
Related tools
Behaviour verified in Node on 24 November 2026. Everything runs in your browser — nothing you type is sent anywhere.