Gradient CSS Generator
Blend two or three colors into a beautiful background for banners, buttons, cards and heroes. Pick your colors, drag the stops, switch the orientation — the preview and the CSS update instantly. Super easy to use and a super time saver.
Gradient settings
Ready-made gradients — click any card to copy its CSS
Eight combinations that work out of the box. Clicking a card copies the full declaration to your clipboard and loads it into the generator above so you can keep adjusting the colors and stops.
The CSS you need to build this yourself
Gradients sit at the crossing point of color theory and backgrounds. Take these lessons on our learning path — in order — and you'll be writing gradients by hand, and understanding why they render the way they do:
Top 10 related generators
Gradients rarely travel alone — these tools live in the same toolbox:
- Text GradientClip your gradient to a headline
- GlassmorphismFrosted panels over gradient backdrops
- Pattern GeneratorRepeating gradients become stripes & grids
- Noise TextureGrain that kills gradient banding
- Box Shadow GeneratorDepth for your gradient cards
- Button StylerGradient fills that feel clickable
- Neon Text GeneratorGlow that matches your palette
- Border Radius GeneratorRound the corners of gradient panels
- Hover EffectsShift gradients on interaction
- Layer StylesGradient + shadow + border in one
How CSS gradients work
A CSS gradient is not a color — it's a generated image. That's why it goes in the background (or background-image) property, why you can layer several of them with commas, and why a plain color fallback line matters for very old browsers. Three functions cover every shape of blend:
| Function | Blends along… | Typical use |
|---|---|---|
linear-gradient() | A straight line at any angle | Heroes, buttons, banners |
radial-gradient() | Rays out from a center point | Glows, spotlights, vignettes |
conic-gradient() | Around a circle, like a clock | Pie charts, color wheels, borders |
.hero { background: #3E6787; /* fallback for ancient browsers */ background: linear-gradient(135deg, #3E6787 0%, #63B29A 100%); }
Color stops: where the blend happens
Each color in the list can carry a position — #3E6787 0% means "be exactly this color at 0% of the line." Between two stops the browser interpolates; outside them, the nearest color extends solid. Push two stops to the same position and the blend collapses into a hard edge — which is precisely how the Pattern Generator turns gradients into stripes.
The angle
For linear gradients, 0deg points up, 90deg points right, and 180deg points down — the angle is the direction the gradient travels toward. Keyword forms like to bottom right exist too, but degrees give you the fine control this generator's angle slider exposes.
Killing gradient banding
Long, subtle gradients can show visible "bands" of color on some screens, because 8-bit color runs out of in-between shades. Two proven fixes: keep your two colors closer in lightness, or overlay a whisper of grain from our Noise Texture tool — the noise dithers the bands away. This is the same trick film and game studios use.
Can you animate a gradient?
Not directly — background-image isn't interpolable, so a transition between two gradients just snaps. The workhorse trick: make the gradient larger than the element with background-size: 200% 100% and animate background-position instead (the buttons on this very site do exactly that on hover). The Transitions lesson walks through it step by step.
Run the code — try it yourself
The editor below is live. Your task: the hero section is flat navy. Turn it into a diagonal Ocean gradient — replace the solid background in .hero with a 135° linear gradient from #3E6787 to #63B29A (tip: click the Ocean example above to copy it). Press Run Code — or Ctrl/Cmd + Enter.
Frequently asked questions
Is this gradient generator free to use?
Completely free — no account, no watermark, no usage limit. CSSmatic is a non-profit project made by developers for developers, and every gradient you copy from this page is yours for personal or commercial work.
Which browsers support CSS gradients?
All modern browsers support unprefixed linear-gradient() and radial-gradient(); conic-gradient() has been universal since 2020. The solid-color fallback line the generator includes only matters for museum-grade browsers, and costs nothing to keep.
Where can I use a gradient besides backgrounds?
Anywhere an image is accepted: border-image for gradient borders, mask-image for fade-outs, and — clipped with background-clip: text — inside text itself. Our Text Gradient tool generates that last one for you.
What's the difference between linear, radial and conic?
Picture the path the blend travels: linear moves along a straight line at your chosen angle; radial radiates outward from a center point like ripples; conic sweeps around a center point like a clock hand. Same color stops, three different geometries — flip between them in the generator to feel the difference.
Why does my gradient look stripey or "banded"?
Displays only have so many shades between two colors; stretch a subtle blend across a large area and the steps become visible. Fixes: pick end colors closer in brightness, shorten the gradient, or overlay fine noise from the Noise Texture tool to dither the bands invisible.
How do I put text on a gradient and keep it readable?
Test contrast against the gradient's lightest point, not its average. When in doubt, add a translucent dark overlay (linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.35)) layered on top — remember, you can comma-stack gradients) or a subtle text-shadow from our Text Shadow tool.
Can I stack more than one gradient on the same element?
Yes — comma-separate them in one background declaration and they layer top-to-bottom like transparencies. Overlay a translucent radial glow on a linear base for depth, or combine dozens of hard-stop gradients to draw entire patterns. The first gradient in the list paints on top.
From flat color to living color
Throwing a gradient on almost anything makes it look a million times nicer — but the difference between a good gradient and a garish one is restraint. Neighboring hues, gentle angle, stops that breathe. These gradients can be used as backgrounds for banners, wallpapers, buttons and cards; keep this page bookmarked for the sliders, but aim for the day you can type linear-gradient(135deg, …) without thinking.
Natural next steps: the Gradients lesson for the complete theory, the Text Gradient tool to put your blend inside a headline, and the Glassmorphism generator to float frosted panels over what you just made. Every lesson and tool on CSSmatic is free and interlinked — wherever you go next, the path continues.
CSSmatic is a non-profit project, made by developers for developers. Found a bug or want to collaborate? Contact us.