CSS Gradient Generator
Design multi-stop CSS gradients with live preview and copy CSS.
Recommended tools
Affiliate links — we may earn a commission if you sign up.
About the CSS Gradient Generator
The CSS Gradient Generator constructs multi-stop gradients and emits the exact background declaration you can paste into a stylesheet. Switch between Linear and Radial with the tabs, and for linear gradients an Angle slider sweeps from 0 to 360 degrees in 5-degree steps to control direction. Color stops are the heart of the tool: each row holds a color picker, a hex field, a numeric position from 0 to 100 percent, and a position slider, and sections are numbered in order. The Add stop button appends a new stop, colored emerald by default and placed a quarter of the way back from the previous last stop, while the remove button stays disabled until you hold more than the minimum two. Stops are sorted by position before rendering, so dragging them later reorders the gradient automatically. The preview panel paints a full-width swatch with the live gradient so color changes are visible immediately. The CSS result appears in a result box prefixed with the background property, ready for one-click copy or download as gradient.css. Radial gradients always emit circle at center, radiating from the middle of the element rather than along an angle.
Examples
Type Linear · Angle 135 · Stops: #7c3aed at 0% and #ec4899 at 100% (defaults)
background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
Type Radial · Stops: #0ea5e9 at 0%, #10b981 at 50%, #ec4899 at 100%
background: radial-gradient(circle at center, #0ea5e9 0%, #10b981 50%, #ec4899 100%);
Type Linear · Angle 90 · Stops added in the order #7c3aed at 0%, #10b981 at 100%, then #ec4899 at 50%
background: linear-gradient(90deg, #7c3aed 0%, #ec4899 50%, #10b981 100%);
How to use
- 1
Pick Linear or Radial from the tab strip at the top; radial mode hides the angle control and adds a short note about center radiation.
- 2
Drag the Angle slider for the gradient direction in degrees; the hint shows the current value as you move it.
- 3
Edit each Color stop's color with the picker or hex field, and set its position with the number input or the slider.
- 4
Click Add stop to append another color row, or the trash icon to remove a stop while more than two remain.
- 5
Copy the CSS from the result box or download it as gradient.css, then paste the background declaration straight into your stylesheet.
Common use cases
- Landing page heroes — a diagonal linear gradient between two brand colors gives a header depth behind the headline and CTA.
- CTA buttons — a tight two-stop gradient with strong contrast between stops makes the invite action feel tactile and clickable.
- Section dividers — a soft radial fade from a light accent color into the page background transitions related blocks gracefully.
- Social media banners — export a gradient as the base of cover art, then overlay text and icons in a consistent brand palette.
- Marketing emails — a compact linear gradient keeps an intro block on-brand inside clients that ignore background images.
- Product onboarding screens — radial gradients focus attention on a central illustration instead of scattering it across the screen.
Best practices
- Keep stop positions monotonic by dragging them into order; the generator sorts automatically, but tidy input keeps the preview intuitive.
- Clamp positions to the 0-100 range manually if you type values; out-of-range positions get clamped on render, so verify the preview.
- Use radial gradients for spotlight effects over a background element and reserve linear diagonals for directional transitions.
- Test any text overlaid on the gradient against the actual blend using the contrast checker, since mid-gradient colors are darker than either stop.
- Limit a single gradient to three or four stops; more bands read as visual noise and awkward color compression in smooth transitions.
- Copy the background property from the result box rather than retyping it, so the exact declaration ships into the stylesheet unchanged.
Tips
- Save your most-used three-stop combinations from this tool into design tokens; they stay consistent across every page that reuses them.
- Test the gradient against both light and dark text by pasting the two overlaid colors through the contrast checker before publishing.
- Angles ending in 5 or 0 tend to read as intentional direction; off-angle values like 137 feel slightly organic in large hero panels.
- After adding a stop at 75 percent as a midpoint, drag it slightly and re-copy; the output changes live, so recopy after every tweak.
Frequently asked questions
Explore more media tools
Browse the full collection of media tools on the hub, or jump back to all categories.