About the CSS Gradient Generator
A CSS gradient renders a smooth transition between two or more colours, either linearly along an axis or radially outward from a focal point. Gradients are one of the cheapest ways to add visual interest to a UI without adding image weight, and they remain crisp at every zoom level because the browser renders them mathematically rather than from pixel data.
This tool builds linear and radial gradients visually, lets you adjust direction, colour stops, and stop positions, and outputs the ready-to-paste CSS. The CSS uses the standard background-image syntax and is compatible with every modern browser without prefixes.
Linear versus radial
A linear gradient transitions colours along a straight line — useful for backgrounds, headers, and any directional emphasis. A radial gradient transitions from a centre point outwards in concentric shapes — useful for spotlights, decorative orbs, and subtle vignettes. Conic gradients (the third standard) sweep colour around a centre point and are excellent for pie charts and clock faces.
Colour stops and positioning
Each colour in a gradient has an associated position (0% to 100% along the gradient axis). With two stops at 0% and 100%, the transition is even. Adding a third stop in the middle or skewing the position lets you control where the colours bleed into each other, producing harder edges or longer fades. Multiple colours can sit side by side as solid bands by giving them adjacent stop positions, which is useful for striped backgrounds.
How to use the CSS Gradient Generator
Pick gradient type
Choose linear or radial.
Set colours and stops
Add at least two colour stops. Drag to reposition or change the colour using the colour picker.
Adjust direction (linear) or shape (radial)
Linear gradients have an angle in degrees. Radial gradients can be circular or elliptical, with a specifiable centre.
Copy the generated CSS
Paste it into a background-image property. The browser does the rendering.
Worked examples
Example 1
Input: Linear, blue to purple, 135deg
Result: background-image: linear-gradient(135deg, #3b82f6, #8b5cf6);
A common modern UI hero gradient.
Example 2
Input: Radial, circle at centre, white to transparent
Result: background-image: radial-gradient(circle at center, white, transparent 70%);
A spotlight or vignette effect.
Real-world use cases
- Designing hero section backgrounds without using image assets.
- Creating coloured button hover states with subtle direction.
- Building decorative dividers and section backgrounds.
- Simulating soft lighting effects in flat UI designs.
- Producing CSS for newsletter or email header banners (with care for email client compatibility).
Tips & common mistakes
- Use HSL colours when adjusting gradients — going from one HSL hue to another produces smoother transitions than naive RGB interpolation.
- For backgrounds, keep the contrast subtle if text will sit on top. A vivid gradient and white body text is rarely readable.
- Conic gradients are widely supported as of 2022 and worth exploring for non-linear designs.
- Test gradients on both light and dark themes if your site has theme switching — a gradient that looks great on light can be muddy or harsh on dark.
Frequently asked questions
Do CSS gradients work in older browsers?
Linear and radial gradients work in every browser released after 2013 without prefixes. Conic gradients require browsers from around 2022 onwards.
Are gradients accessible?
Gradients themselves are neutral, but text legibility over a gradient depends entirely on contrast. Always check WCAG contrast against the worst spot of the gradient, not the best.
Can I animate a gradient?
Not directly via the background-image property in most browsers. You can simulate motion by animating background-position with a large gradient, or use the modern @property and registered CSS variables for smooth interpolation.
Will gradient backgrounds slow down my page?
No measurable amount. They are GPU-cheap and add zero bytes to your HTTP transfer.
Related tools
Last updated: June 2026 · All processing happens locally in your browser.