Free CSS Gradient Generator

Make linear, radial, and conic CSS gradients with up to 8 stops, alpha transparency, and any angle. Live preview, one-click copy CSS code, no signup. Below the tool: 30 ready-to-copy examples and a complete gradient reference guide.

°
Picker
Hex
R
G
B
A
Stops
Palettes
Loading…
Loading palettes…
Open in Studio

Carries this exact gradient. Animate it, export MP4, or pick from 22 gradient modes.

CSS
background: #08102A;
background: linear-gradient(160deg, rgba(8, 16, 42, 1.00) 0%, rgba(24, 48, 168, 1.00) 50%, rgba(0, 208, 232, 1.00) 100%);

How to make a CSS gradient in 6 steps

A free tool to build linear, radial, and conic CSS gradients with multiple color stops, alpha transparency, and any angle. Tweak it live, then copy the CSS — works in every modern browser.

1. Pick a gradient type

Linear flows in one direction, radial radiates from the center, and conic sweeps around a point. Switch types anytime — your colors carry over.

2. Adjust the angle

For linear and conic gradients, drag the angle dial or type a value 0–360°. Radial gradients ignore the angle.

3. Add or move color stops

Click the gradient bar to add a stop, drag any marker to change its position, or use the % field for exact placement. Up to 8 stops.

4. Set alpha for transparency

Drop the alpha slider below 100% on any stop to fade into transparency. Transparent CSS gradients are great for overlays and glass effects.

5. Try a curated palette

Browse 10,000+ palettes by color or tag in the side panel. Click one to apply all colors as evenly-spaced stops.

6. Copy the CSS

The code block updates live with a working background fallback and the gradient declaration. Toggle Max Compatibility for legacy browser prefixes.

Gallery

30 popular CSS gradient examples

Hand-picked linear, radial, and conic gradients with copy-paste CSS. From classic sunsets and auroras to glassmorphism and iridescent conic patterns — drop one straight into your stylesheet.

Sunset
Aurora
Cosmic Fusion
Witching Hour
Mojito
Frost
Peach Sky
Lavender Mist
Mango Tango
Plum Punch
Deep Sea
Neon Pulse
Ember
Forest Floor
Royal Velvet
Citrus Burst
Cotton Candy
Sunrise Glow
Northern Lights
Iridescent
Moonlit Path
Tropical Punch
Midnight Bloom
Spring Meadow
Cherry Blossom
Glacier
Magma
Twilight Pulse
Soft Linen
Glassmorphism
Reference

The complete CSS gradient guide

Everything you need to know to make CSS gradients with confidence — syntax, browser support, transparency, animation, accessibility, and the patterns designers actually use.

What is a CSS gradient?

A CSS gradient is a smooth color transition rendered natively by the browser as a background image. Because it's drawn by the engine instead of loaded from disk, a gradient is infinitely scalable, has zero network cost, and animates cheaply. The CSS specification defines three official gradient functions: linear-gradient(), radial-gradient(), and conic-gradient(). Each is set as a value of background-image (or any property that accepts an image), and each can be combined with the others by stacking them in a comma-separated list.

Gradients are not images. You can't resize them with width or heightthe way you would a JPEG, and they don't carry alt text. Search engines treat them as decoration. That makes them perfect for hero backgrounds, button surfaces, divider lines, and anywhere you'd otherwise reach for a flat color but want a touch more depth. The trade-off is small: gradients can't be inspected or downloaded by users the way an image can, but for visual styling, that's exactly what you want.

Linear gradients (linear-gradient)

A linear gradient flows in a straight line from one color to another. Direction is controlled by an angle in degrees (0deg points up, 90deg points right, 180deg points down) or by a keyword like to right or to bottom right. The minimum syntax is two color stops:

background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);

You can add as many stops as you need. Each stop is a color followed by an optional position (a percentage or length). When you omit positions, the browser distributes stops evenly. A useful trick: place two stops at the same percentage to create a hard edge — that's how stripes and split backgrounds are made without an SVG.

background: linear-gradient(90deg, #4FACFE 50%, #00F2FE 50%);

For backgrounds and banners, linear-gradient(135deg, ...) is the most-used direction because diagonal flows feel more dynamic than vertical or horizontal ones. Vertical (180deg) is best for fade-to-bottom hero overlays where you want to keep text legible against a photo. Horizontal (90deg) is the go-to for progress bars, sliders, and divider lines.

Radial gradients (radial-gradient)

A radial gradient radiates outward from a single point. The shape can be a circle or an ellipse, sized to a keyword (closest-side, farthest-corner) or to explicit dimensions, and positioned anywhere with the at keyword. The most common form keeps the gradient circular and centered:

background: radial-gradient(circle at 50% 50%, #FF6CAB 0%, #7366FF 100%);

Radial gradients are perfect for spotlights, vignettes, and soft glows. Off-center the gradient with at 30% 100% and you get a sunrise-style glow rising from the bottom-left. Stretch it into an ellipse for wide horizon effects. They also stack beautifully — put a radial highlight on top of a linear base for the glassmorphism look used in modern dashboard UI.

Conic gradients (conic-gradient)

Conic gradients are the newest of the three. Colors sweep around a center point in a circle, the way a clock hand moves. They're what you reach for when you need a pie chart, a color wheel, an iridescent foil shimmer, or an angle-based highlight. The starting angle is controlled with from, and the center with at:

background: conic-gradient(from 180deg at 50% 50%, #FF6CAB, #7366FF, #43E97B, #FFE259, #FF6CAB);

Note that the last stop matches the first — that's how you avoid a hard seam where the sweep wraps around. Conic gradients ship in every browser released since 2020, but if you need to support older Safari or Edge, fall back to a static SVG or a plain linear-gradient.

Transparency and alpha gradients

Every color stop accepts alpha. The simplest way is the modern 8-digit hex (#RRGGBBAA) where the last two digits are the opacity, but you can also use rgba() or hsla() with explicit alpha. A gradient that fades into transparency is the foundation of overlay effects: a dark linear-gradient on top of a hero image keeps headline text legible, and a soft radial-gradient inside a card creates a glass surface.

background:
  linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%),
  url('/photo.jpg') center/cover;

Layering works because background-image accepts a comma-separated list of images. The first image in the list paints on top. To get a clean fade, animate the alpha channel rather than the color — your eye is much more sensitive to opacity changes than to hue shifts, and animated alpha gradients render at 60 fps even on cheap hardware.

Animating CSS gradients

Native CSS can't animate background-image directly because the engine doesn't interpolate between two gradient strings. The two reliable workarounds are: animate background-position on a long gradient and let the viewport scroll across it, or animate registered @property custom properties that feed into the gradient.

@property --c1 { syntax: '<color>'; inherits: false; initial-value: #FF512F; }
@property --c2 { syntax: '<color>'; inherits: false; initial-value: #DD2476; }
.hero {
  background: linear-gradient(135deg, var(--c1), var(--c2));
  animation: shift 6s ease-in-out infinite alternate;
}
@keyframes shift { to { --c1: #4FACFE; --c2: #00F2FE; } }

For more advanced animation — mesh gradients, holographic sheen, fluid metaballs, animated particle fields — you'll quickly outgrow what CSS can do alone. Those are the cases an animated gradient generator that exports as MP4 or React component is worth using; ours covers all of them in Studio.

Browser support

linear-gradient() and radial-gradient() have been universally supported since 2012 in every modern browser, including all current versions of Chrome, Firefox, Safari, and Edge. conic-gradient() shipped in Chrome 69 (2018), Firefox 83 (2020), and Safari 12.1 (2019); coverage is now ~98% globally per caniuse. The only place you'll hit issues is IE11 and very old Android WebView — for those, our Max Compatibility toggle adds -webkit-, -moz-, -o-, and -ms- prefixed versions.

Common gradient patterns

A few patterns turn up in production CSS over and over. Memorise these and you'll cover 80% of real-world use:

  • Hero overlay: a vertical linear-gradient(180deg, transparent, rgba(0,0,0,0.6)) on top of a photo so headline text stays legible.
  • Button surface: a subtle 135° two-stop gradient that lifts a flat brand color into something with depth.
  • Glassmorphism: a low-alpha linear gradient inside a frosted card, paired with backdrop-filter: blur().
  • Gradient text: apply background-clip: text with color: transparent to make headlines paint with a gradient instead of a solid colour.
  • Skeleton loaders: a tall linear-gradient(90deg, ...) with a moving background-position creates the shimmer effect ubiquitous in loading states.
  • Mesh-style backgrounds: stack three or four oversized radial-gradient()s at different positions and let them blend through each other.

Accessibility considerations

Gradients can quietly tank contrast. Always test text colours against the darkest point of a gradient background, not the lightest. The WebAIM contrast checker only takes a single colour, so when in doubt, sample the gradient in DevTools at the spot where text actually sits. For animated gradients, respect prefers-reduced-motion: reduce; users with vestibular disorders can experience real discomfort from continuously shifting backgrounds.

Performance

Static gradients are essentially free — a single linear-gradient compiles to a few GPU instructions and adds nothing measurable to paint time. Where you can hit perf walls is animating large gradient backgrounds, especially on mobile. Two rules: animate transform and opacity instead of background-imagewherever possible, and keep animated gradient backgrounds off elements larger than the viewport. If you genuinely need a full-screen animated mesh gradient, pre-render it to a 4-second loop MP4 — the browser's video decoder is faster than its CSS animation pipeline at that scale, and a 1080p loop weighs less than 200 KB.

Copy-paste CSS gradient code

Use the generator at the top of this page for an interactive build, or browse the example gallery below for ready-made snippets. Each gallery card has a single Copy CSS button that puts the full background: linear-gradient(...) declaration on your clipboard. Paste it into any element's style block — works in vanilla CSS, in Tailwind's arbitrary value syntax (bg-[linear-gradient(...)]), in CSS-in-JS, in React style props, in SwiftUI's LinearGradient with minor reshaping, and in Figma. Gradient code is portable; the same hex stops render identically everywhere.

Beyond CSS

More gradient generators

CSS gradients cover the basics. Studio adds specialized gradient engines — animated mesh gradients, WebGL shaders, holographic effects, metaballs, noise, and more. Free to try, export as PNG, MP4, or production code.

CSS gradient FAQ

What is a CSS gradient?

A CSS gradient is a smooth color transition you can use as a background image. The three official types are linear-gradient, radial-gradient, and conic-gradient. They render natively in every modern browser — no images, no JavaScript.

Linear vs radial vs conic — which should I use?

Linear is best for backgrounds, banners, and buttons (one color flows into another in a straight line). Radial works for spotlights and soft glows from a center point. Conic sweeps colors around a point — ideal for pie charts, color wheels, and angle-based effects.

How do I make a CSS gradient transparent?

Use the alpha channel on any color stop — drop the A slider below 100% to fade that stop into transparency. The generator outputs the rgba() form so the gradient blends correctly over any background.

Can I animate a CSS gradient?

Native CSS only animates @property-registered custom properties (or background-position scrolling on a long gradient). For richer animated gradients — mesh, shader, holographic — use Studio mode and export as MP4 or as a React component.

How do I make gradient text in CSS?

Set background-image to your gradient on the text element, then add background-clip: text and color: transparent (with the -webkit- prefix for Safari). The text fills with the gradient instead of a solid color.

How many color stops can a CSS gradient have?

There is no hard limit in the spec — browsers happily render hundreds. Practically, 2–6 stops covers almost every design need; this generator caps at 8 because beyond that the visual benefit drops off and the CSS becomes hard to maintain.

Can I use CSS gradients as borders?

Yes — set border: 1px solid transparent, then use the border-image property with a linear-gradient. Or use a wrapping div with a gradient background and an inset child to fake a 1px gradient border with full corner radius support.

Are these gradients free to use commercially?

Yes. Anything you copy from this generator is plain CSS you wrote — use it on any project, paid or free, no attribution required. The curated palette library is also free for commercial use.

Why do conic and radial look different in older browsers?

conic-gradient ships in every browser released since 2020 but older versions of Safari and Edge may need a fallback. Toggle Max Compatibility to add vendor prefixes for IE6+ and legacy WebKit.

How do I add a CSS gradient to a Tailwind project?

Use Tailwind’s arbitrary value syntax: bg-[linear-gradient(135deg,_#FF512F_0%,_#DD2476_100%)]. Or define it once in tailwind.config.js under theme.extend.backgroundImage and reference it as a class.

Chrome
Free Chrome Extension

Beautiful gradients on every new tab

Animated gradients, focus timer, tasks, notes, weather, and 800+ daily quotes. Your most productive new tab, completely free.

500K+
Unique Gradients
3700+
Color Palettes
800+
Daily Quotes
0
Ads