CSS Gradient Generator
Use this free CSS gradient generator to build linear or radial gradients, add colour stops and set their positions, then copy live-updating CSS. The visual preview and generated code update as you edit.
Add color stops, drag the sliders, and the preview and code update live.
background: linear-gradient(90deg, #6366f1 0%, #38bdf8 100%);
What Is a CSS Gradient?
A CSS gradient smoothly blends two or more colors without needing an image file โ it's pure CSS, rendered by the browser, scales perfectly at any resolution, and loads instantly. Gradients are everywhere in modern web design: hero backgrounds, buttons, overlays, and decorative accents.
Linear vs. Radial Gradients
radial-gradient(circle, color1 stop1%, color2 stop2%, ...)
A linear gradient transitions along a straight line at a specified angle. A radial gradient radiates outward from a center point โ useful for spotlight effects, glows, or circular color transitions.
How to Use This Generator
Pick linear or radial. For linear gradients, set the angle (0ยฐ points up, 90ยฐ points right, 180ยฐ points down). Add or remove color stops, pick colors with the color pickers, and drag each stop's position slider. The preview and the CSS code update instantly โ click Copy when you're happy with it.
Understanding Color Stops
Each color stop has a color and a position (0% to 100%) along the gradient. Two stops create a simple two-color blend; adding more stops lets you build multi-color transitions, sharp color bands (by placing two stops very close together), or asymmetric blends by clustering stops toward one end.
Common Gradient Angles
- 0deg / to top: transitions from bottom to top
- 90deg / to right: transitions left to right
- 180deg / to bottom: transitions top to bottom (a very common default)
- 135deg: a popular diagonal "top-left to bottom-right" look
Browser Support
CSS gradients are supported in all modern browsers without prefixes. Only very old browser versions (largely obsolete today) required vendor prefixes like `-webkit-linear-gradient` โ for any current project, the unprefixed syntax this generator produces works everywhere.
Where This Fits
Pair this with our color converter for finding exact color values, or our image color picker to pull colors from an existing design.
Frequently Asked Questions
Checking a generated CSS gradient
Choose the gradient type, colours and stop positions, then copy the CSS declaration into a test component. A linear gradient follows an angle or direction; a radial gradient expands from a centre point.
For example, a two-stop background can create a subtle surface tint, while three stops can add a highlight. Check contrast and reduced-motion or theme requirements in the actual interface before shipping.
Thank you for reading this post, don't forget to subscribe!
Explore All NerdyTools By Categories
Find the right tool for any task โ free, fast, and no sign-up required
