How to Create Better Gradient Backgrounds for Modern UI
Create cleaner gradients for hero sections, cards, and product surfaces without banding, muddy blends, or cheap-looking transitions.
Read GuideGradient
Create smooth two-color linear gradients and copy the CSS in one click.
Gradient
This gradient generator blends a start color into an end color along any direction you choose with the angle slider, from 0 to 360 degrees. A live preview updates as you work, and the tool writes the matching background: linear-gradient() declaration, ready to paste into your CSS. It keeps things simple with exactly two colors, which suits clean hero sections, buttons, cards and social graphics; when you need a third color, the Multi-Color Gradient Generator adds a middle stop.
To keep text readable on a gradient, check its contrast against both end colors, not just the middle, because the weakest point is wherever the background comes closest to the text color. If one end fails, darken or lighten that end, or place a semi-transparent overlay behind the text. Gradients between neighboring hues, or one hue at two lightness levels, also tend to look smoother and more polished than big jumps across the color wheel.
FAQ
Use the background property with linear-gradient(), giving a direction and at least two colors, for example background: linear-gradient(135deg, #ff7e5f, #feb47b);. The browser draws a smooth blend between the colors across the element. This generator writes that line for you from the colors and angle you choose.
The angle sets the direction in which the gradient travels, with angles increasing clockwise. 0deg runs from bottom to top, 90deg from left to right, 180deg from top to bottom, which is the default, and 270deg from right to left. A value like 135deg runs diagonally from the top-left corner toward the bottom-right.
Browsers blend gradients in sRGB by default, and a straight path between distant hues, such as blue and orange, passes through dull, grayish colors. Choosing hues closer together or adding a bright middle color fixes it. In modern CSS you can also write linear-gradient(90deg in oklch, ...) to interpolate around the hue wheel instead.
A linear gradient changes color along a straight line, a radial gradient spreads outward from a center point in a circle or ellipse, and a conic gradient sweeps around a center point like the hands of a clock. This tool creates two-color linear gradients; the CSS Gradient Code Generator also covers radial and conic types.
Learn more
Create cleaner gradients for hero sections, cards, and product surfaces without banding, muddy blends, or cheap-looking transitions.
Read GuideBuild an animated gradient in CSS with background-position keyframes, calm timing, prefers-reduced-motion support, GPU-friendly layers and @property angles.
Read GuideCreate a CSS gradient border that respects border-radius: border-image, the padding-box double background, and a mask trick for fully transparent centers.
Read Guide