CSS Gradient Generator

Build any CSS gradient visually. Five gradient types including repeating. Per-stop opacity, direction shortcuts, colour format output (hex/rgb/hsl), vendor prefixes, custom CSS selector and 20 categorised presets. Click the preview bar to add colour stops.

css-gradient.tool
Presets

Five Gradient Types

  • Linear — transitions colours along a straight line. Control the angle precisely with the slider or use the direction shortcuts (→ ↓ ↗ etc.).
  • Radial — radiates from a centre point outward in a circle.
  • Conic — rotates colour stops around a centre point. Used for pie charts, colour wheels, and angular decorative elements.
  • Repeating Linear — tiles the gradient pattern repeatedly across the element. Useful for stripes, ruled lines, and repeated patterns.
  • Repeating Radial — tiles concentric rings. Used for target/bullseye patterns and ripple effects.

Colour Format Output

Choose whether stop colours are written as HEX (#00d4ff), RGB (rgb(0, 212, 255)), or HSL (hsl(192, 100%, 50%)) in the generated CSS. When a stop has opacity below 1, the output always uses rgba() regardless of the format setting — this is the only valid way to express transparency in gradient stops.

CSS Selector and Vendor Prefixes

Type your actual CSS selector in the selector field — .hero, #banner, body — and the output is a complete, paste-ready CSS rule block. Tick "Vendor prefixes" to add -webkit-linear-gradient alongside the standard property for maximum browser compatibility in older environments.

Repeating Gradients

repeating-linear-gradient() and repeating-radial-gradient() tile the defined gradient pattern. The key is to set your colour stops within a short range — for example stops at 0%, 5%, and 10% — and the browser repeats that segment across the full element. Useful for diagonal stripes, progress bars, and decorative borders.

Frequently Asked Questions

A regular linear-gradient fills the element once, stretching the colour stops from edge to edge. repeating-linear-gradient tiles the defined colour pattern repeatedly. To create visible stripes, set your colour stops within a small range — stops at 0%, 10%, 10%, 20% create a hard-edged stripe pattern that repeats every 20%. Stops that overlap create sharp edges; gradually changing stops create soft repeating bands.
Set the alpha (opacity) slider on one of your colour stops to 0. When a stop's alpha is below 1, the tool automatically outputs rgba() for that stop regardless of your colour format setting. For example, a gradient from a solid colour to transparent looks like: linear-gradient(90deg, #00d4ff 0%, rgba(0, 212, 255, 0) 100%). This lets the background or image beneath show through.
It customises the selector in the output CSS block. Instead of the generic .element wrapper, type your actual class or ID — .hero-section, #main-banner, body — and the copied CSS is ready to paste directly into your stylesheet without editing. You can also enter multiple selectors like .card, .panel for the CSS to apply to both.
Modern browsers (Chrome 26+, Firefox 16+, Safari 7+, Edge 12+) all support unprefixed CSS gradients. Vendor prefixes (-webkit-) are only needed for very old browsers that are now used by less than 0.1% of users. For most projects in 2025, skip the prefixes. If you specifically need to support old iOS Safari (before 7) or very old Android browsers, tick the vendor prefix option.
Conic gradients rotate colour stops around a centre point rather than across a line. This makes them ideal for: pie charts and donut charts in pure CSS (no JavaScript), colour wheel displays, angular decorative badges, and hardstop checkerboard patterns. They are fully supported in Chrome 69+, Firefox 83+, and Safari 12.1+. The angle slider controls where the first colour begins.
Yes, with extra CSS. For gradient text: set background to your gradient, then add -webkit-background-clip: text and -webkit-text-fill-color: transparent. For gradient borders: use border-image with your gradient value and set border-image-slice: 1. Both techniques work in all modern browsers, though border-image removes border-radius. An alternative for rounded gradient borders uses a pseudo-element with the gradient as the background.