CSS Gradient Generator
Build linear and radial CSS gradients and copy the code.
About the CSS Gradient Generator
Gradients are back — subtle two-tone backgrounds on hero sections, buttons and cards are one of the defining looks of modern interfaces, and CSS renders them natively with no image files. This generator writes the code for you: choose your two colours, pick linear or radial, set the angle, and copy a clean background declaration ready to paste into any stylesheet.
The linear angle follows CSS convention: 0° points the gradient upward (start colour at the bottom), 90° points right, and the popular 135° runs diagonally from top-left to bottom-right — the default here because it flatters most layouts. Radial gradients bloom from the centre outward, suited to spotlight effects and circular elements. The output also includes a solid-colour fallback line, so ancient browsers that predate gradient support show your start colour rather than nothing.
Two colours make a gradient; taste makes it a good one. Neighbouring hues (indigo to violet, teal to blue) blend smoothly, while opposites can meet in a muddy grey midpoint — if you want a bold two-colour statement, pick colours that share some undertone. Keeping both stops at similar lightness avoids the washed-out band in the middle. For text overlays, check contrast against both ends of the gradient, not just one. If you need a hand relating colours, the colour converter next door shows every colour's hue/saturation/lightness so you can pick companions deliberately.
Frequently asked questions
- How do gradient angles work in CSS?
- The angle is the direction the gradient travels: 0° points up, 90° right, 180° down. 135° — top-left toward bottom-right — is the most common choice for backgrounds.
- Can I use more than two colours?
- CSS supports any number of colour stops — take the generated code and add more comma-separated stops with percentages, e.g. linear-gradient(135deg, #4f46e5 0%, #9333ea 50%, #ec4899 100%).
- Why does the middle of my gradient look grey?
- Colours far apart on the colour wheel pass through desaturated territory when interpolated. Choose closer hues, or add a vivid intermediate colour stop at 50%.
Related tools
Convert any colour between HEX, RGB and HSL formats.
Favicon GeneratorGenerate a full set of favicon PNGs plus the HTML to reference them.
Meta Tag GeneratorGenerate a complete HTML head block — title, description, Open Graph and Twitter tags.
Image Color PickerClick anywhere on an image to get its exact hex and RGB colour.