🎨 CSS Gradient Generator
Build linear, radial & conic gradients visually - copy CSS instantly
background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);How to Use the CSS Gradient Generator
Create beautiful CSS gradients without memorising syntax. Pick gradient type (linear flows in a direction, radial radiates from a point, conic sweeps around a center), adjust the angle, add colour stops, and see the live preview instantly. Copy the ready-to-use CSS line with one click and paste it into your stylesheet.
- 1.Choose gradient type: Linear for directional fades, Radial for circular glows, Conic for pie-chart style sweeps.
- 2.Set the angle (0 degrees = top, 90 degrees = right, 135 degrees = diagonal top-left to bottom-right).
- 3.Click each colour swatch to change the colour, or type a hex code. Drag the slider to set the position.
- 4.Add more colour stops with the + Add Stop button for multi-colour gradients.
- 5.Click Copy to copy the background CSS line and paste it directly into your stylesheet.
background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);What is the difference between linear, radial, and conic gradients?
A linear gradient transitions colors along a straight line at a given angle (0deg = bottom to top, 90deg = left to right, 135deg = diagonal). A radial gradient radiates outward from a center point in an elliptical or circular pattern. A conic gradient sweeps colors around a center point like a color wheel or pie chart. Linear gradients are most common for backgrounds and overlays. Radial gradients create depth and spotlight effects. Conic gradients are useful for pie chart backgrounds, color wheel selectors, and unique UI effects.
How do I create a gradient with a hard edge instead of a smooth transition?
Place two color stops at the same position: background: linear-gradient(to right, blue 50%, red 50%) creates a sharp split at 50%. Combine hard stops with smooth gradients: linear-gradient(to right, blue, blue 30%, red 30%, red) creates solid blue then solid red sections. This technique creates striped backgrounds, progress bar segments, and split-screen effects.
Why does my gradient look different between Chrome and Safari?
Gradient rendering is generally consistent across modern browsers. Differences arise in edge cases: very long gradients can show color banding due to limited color precision. Conic gradients have slightly different center point defaults in older Safari. The at keyword in radial-gradient (radial-gradient(circle at 20% 80%, ...)) is sometimes required for proper positioning. This tool generates standard CSS without vendor prefixes (-webkit-linear-gradient) since they are no longer needed for Chrome, Firefox, Safari 6+, or Edge.
How do I layer multiple gradients on the same element?
CSS allows multiple backgrounds separated by commas: background: linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.3)), linear-gradient(135deg, #667eea, #764ba2). The first gradient in the list renders on top. A common pattern: layering a semi-transparent dark overlay gradient over an image to improve text legibility: background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('photo.jpg').
What is repeating-linear-gradient?
repeating-linear-gradient tiles the gradient pattern instead of stretching it. With sharp stops, this creates stripes: repeating-linear-gradient(45deg, #fff 0px, #fff 10px, #eee 10px, #eee 20px) creates diagonal stripes 10px wide. The color stop positions define the size of one repeat cycle. Diagonal stripe backgrounds, hazard tape patterns, and progress bar striping all use repeating gradients. The browser handles the tiling automatically.
How do I make a gradient text effect in CSS?
Three CSS properties: background: linear-gradient(...) on the element, -webkit-background-clip: text (clips the background to the text shape), and -webkit-text-fill-color: transparent (makes the text fill transparent so the background shows through). The -webkit- prefix is still required for background-clip: text in some browsers. Generate the gradient CSS here, then add the clip and text-fill properties manually.
What CSS tools complement the Gradient Generator?
The Color Converter translates Figma hex values to HSL for more intuitive color stop adjustments. The Color Contrast Checker verifies that text over your gradient background meets WCAG requirements — test against both the lightest and darkest parts of the gradient. The Box Shadow Generator adds depth to elements with gradient backgrounds. The CSS Animation Generator can animate gradient positions for flowing background effects. All are in the Dev Tools CSS section.
📊 Key Data Points
3 gradient types
linear-gradient, radial-gradient, and conic-gradient
oklch support
Perceptually uniform color space — eliminates muddy grey in the middle of gradients
All CSS colors
Hex, rgb(), hsl(), oklch(), and named colors
CSS Gradient Generator -- Complete USA Guide 2026
CSS gradients appear in hero backgrounds, buttons, cards, and decorative elements — but the syntax for direction, color stops, and color spaces is verbose and hard to visualize without a live preview.
This generator provides a visual gradient builder with real-time CSS output. Runs in your browser.
**Long-tail searches answered here:** css gradient generator with live preview free, linear gradient CSS code builder online, radial conic gradient CSS maker no install.
Pair with Box Shadow Generator and Color Converter.
🔬 How This Calculator Works
Builds linear-gradient(), radial-gradient(), and conic-gradient() CSS values. Linear gradients accept a direction (to right, 45deg) and color stops. Radial gradients add shape (circle vs ellipse) and position. Color stops support hex, rgb(), hsl(), oklch(), and named colors with optional explicit positions. Output includes vendor prefixes when legacy support is enabled.
✅ What You Can Calculate
Live preview as you edit
Gradient updates instantly as you adjust colors, direction, or stop positions — no button clicks.
Linear, radial, and conic
All three CSS gradient types in one tool. Conic gradients for pie-chart backgrounds are especially difficult to hand-write.
Multi-stop support
Add unlimited color stops with independent position control for precise multi-color transitions.
Copy-ready CSS
Output is the complete background: linear-gradient(...) property — paste directly into your stylesheet.
🎯 Real Scenarios & Use Cases
Hero section backgrounds
Most modern landing pages use linear gradients for hero backgrounds. Build and preview at full width here, then copy the CSS.
Button hover states
Adjust color stops until the gradient looks right on your button design, then paste into your component CSS.
Gradient borders
Gradient borders use background-clip: padding-box with a gradient background. Build the gradient here.
CSS-only pie charts
Conic gradients produce pie chart backgrounds without SVG. Build percentage-based conic gradients here.
💡 Pro Tips for Accurate Results
Hard stops for sharp transitions. Two stops at the same position create a sharp line: linear-gradient(red 50%, blue 50%) with no smooth transition. Useful for split backgrounds and striped patterns.
Direction in degrees. 0deg points upward, 90deg rightward, 180deg downward.
oklch for clean gradients. RGB color space produces a muddy grey mid-zone in some gradients. The oklch color space produces perceptually uniform gradients without the muddiness.
Check contrast on text. If placing text over a gradient background, verify contrast at both ends with Color Contrast.
🔗 Use These Together
🏁 Bottom Line
CSS gradients are versatile but verbose to hand-code. This generator handles the syntax while you focus on the visual result. For complete component visual styling: add shadows with Box Shadow Generator and check accessibility with Color Contrast.