Gradient Generator

Drag stops along a ramp instead of typing percentages. Six gradient functions, per-stop transparency, and a PNG or SVG file when the design needs a flat image rather than a CSS rule.

Gradient studio

linear-gradient2 stops

Color stops

Click the ramp to drop a stop. Drag a pin to move it. Arrow keys nudge a selected pin by one percent, Shift by ten.

%

Angle

deg

Zero points up. Values climb clockwise.

Starting points

Two colors and a direction cover a hero banner. A progress ring, a pie-shaped badge, or a striped awning background needs conic and repeating functions, several stops, and sometimes a stop that fades to nothing. This page keeps all six gradient functions on one screen and treats the ramp as the main control.

The ramp is the interface

Every stop lives as a pin on the horizontal track under the preview. Drag one and the number follows the pointer. Click empty track and a new stop appears at the click position, colored by blending the two stops on either side, so an inserted midpoint starts out invisible and shifts only when you change it. Selecting a pin opens the inspector below with hex, position, and opacity for that single stop.

Stop order on screen never matters. The generator sorts by position before it writes the rule, so dragging a pin past its neighbor reorders the gradient without breaking anything.

Six functions, one stop list

Switch between linear-gradient, radial-gradient, conic-gradient, and the three repeating variants without losing your colors. The controls under the type rail swap with the choice:

Repeating functions restart the stop sequence once the last stop is reached. Set your final stop below 100 percent to see it work. A repeating gradient whose last stop sits at 100 percent has nothing left to repeat and renders the same as the plain version.

Conic angles trip people up

A conic gradient sweeps around a center point rather than running along a line. The from value marks where the sweep starts, using the same convention as linear angles: zero points at the top of the box, and the value grows clockwise.

ValueSweep beginsTypical use
from 0degTwelve o'clockProgress rings and donut charts
from 90degThree o'clockSweeps aligned to a right-hand edge
from 180degSix o'clockFan shapes anchored at the bottom
from -45degTen thirtyAngled sheen on a card or button

Hard color changes matter more in conic mode than anywhere else. Two stops sharing the same position produce a clean edge instead of a blend, which is how pie slices and pointer dials get built. Drag two pins onto the same percent and the seam appears immediately in the preview.

Transparency, and what survives export

Each stop carries its own opacity. Drop a stop below 100 percent and the rule switches that stop from hex to rgba(), while stops at full opacity keep their shorter hex form. The preview sits on a checkerboard so a fade to nothing reads as transparent rather than white.

One detail worth knowing: fading to transparent in older browsers meant fading through transparent black, which greyed the midpoint. Writing the same color with zero alpha, which is what this tool does, keeps the fade clean. If a gradient looks muddy halfway through in an old build target, that is the reason.

Transparency reaches the PNG file, since PNG carries an alpha channel. It reaches SVG too. It does not reach a JPEG conversion later in your pipeline, where anything transparent flattens onto whatever background the converter picks.

Banding, and two fixes

Long gradients across a wide element sometimes show visible steps rather than a smooth ramp. Eight-bit color has 256 levels per channel, and a 1600 pixel wide fade between two close colors asks for more levels than exist.

Banding shows worse on dark gradients and on cheap panels. Check on a phone before deciding the CSS is fine.

Where this page stops

Everything runs in your browser. Nothing about your colors leaves the tab.

Pick a different tool when

You need a plain two-color background rule and nothing else. The CSS Gradient Generator keeps linear and radial on a smaller screen with a ready HTML snippet. You want a set of related flat colors rather than a blend, in which case the Palette Generator or the Harmony Generator fits better. You are building tints of a single brand color for a design system, which is the job of the Tint and Shades Generator.

Gradient questions worth answering

Details people hit once a gradient moves from this preview into a real stylesheet.

Why does my repeating gradient look like a normal one?

The last stop sits at 100 percent, so there is no space left for a second cycle. Drag the final pin down to 20 or 30 percent and the pattern starts repeating across the rest of the box.

How do I get a hard edge instead of a blend?

Put two stops at the same position. The color changes at that exact point with no transition between them. Stacking several pairs this way builds stripes in linear mode and pie slices in conic mode.

What does 0deg mean on the dial?

Zero points at the top of the element and values increase clockwise, matching the CSS specification. So 90deg runs left to right, 180deg runs top to bottom, and 270deg runs right to left. Conic gradients read the same value as the start of their sweep.

Why do some stops print as hex and others as rgba?

Opacity decides. A stop at full opacity prints as a six-digit hex, which is shorter to read. Lower the opacity slider and that stop switches to rgba so the alpha value has somewhere to live.

Does the downloaded PNG match the preview exactly?

For linear, radial, and conic gradients it lines up closely. Repeating variants tile across four cycles in the raster export, and radial reach keywords collapse to one circle radius. Treat the PNG as a fallback asset and keep the CSS rule as the source of truth.

Can I export a conic gradient as SVG?

No. SVG defines linear and radial gradients only, with no conic primitive. Use the PNG export for conic sweeps, or build the shape from stacked paths in a vector editor.

Is there a limit on stops?

Twelve, which is far past the point where a gradient reads as intentional. Two is the minimum, since one stop is a flat background color rather than a gradient.