CSS Gradient Generator
Linear & radial gradients with live preview
A preview bar across the top, controls underneath, and a single CSS declaration at the bottom ready to copy. Linear or radial is a two-button switch, and the angle slider runs from 0 to 360 degrees but appears only for linear, because a radial gradient has no direction to dial. Colour stops are individual rows, each with a swatch, a text field that takes any CSS colour notation, and a slider setting its position as a percentage. Between two and five stops can be held at once, and the declaration is assembled with the stops sorted by position, so the emitted function is always in ascending order regardless of the order you dragged them into. A Random button rolls two related hues and a fresh angle for a starting palette, and the output is a background value rather than a whole rule.
Design linear and radial CSS gradients visually — add and recolor stops, adjust angle and position — then copy production-ready CSS. Dark-mode friendly preview included.
Private CSS Gradient Generator In Your Browser
CSS Gradient Generator is processed locally with client-side JavaScript. Your files never touch a server, and there is no queue to wait in.
How to use CSS Gradient Generator
Choose Linear or Radial; the Angle slider is only shown for a linear gradient.
Edit each color stop row — pick a colour with the swatch, type any CSS colour notation into the field, drag the slider to set the position percentage.
Add more stops with + Add stop, which inserts one at half the last stop's position, or remove a row with its × button down to a minimum of two.
Press the copy button beside CSS output to take a declaration such as background: linear-gradient(135deg, #0d9488 0%, #4ade80 100%);
- Stops are sorted by position before the gradient function is written, so the CSS always reads in ascending order.
- Two to five stops can be held, and a new one is inserted at half the last stop's position instead of being appended at 100%.
- Any CSS colour notation is accepted in the text field, including the hsl() values the Random button produces, not only hex from the swatch.
- Random picks two hues between 60 and 180 degrees apart at 65 to 90 percent saturation, giving a related pair rather than clashing colour.
- A front-end developer builds a hero banner fill by eye and copies the declaration instead of hand-writing the stop list.
- A designer exports two hex values from a palette tool, drops them into two rows and dials the angle to the intended direction.
- Someone prototyping a hover state needs a third mid-point colour and adds a stop at the halfway slider position.