CSS Gradient Generator
Click a curated preset, shuffle a random gradient, or build your own with linear or radial, color stops, and one-click copy.
- Free, no account
- No watermark
- No usage limit
About the CSS Gradient Generator
Most CSS gradient tools drop you on a blank two-color picker and wish you luck. But that blank picker is where the real difficulty is. The code for a gradient is short enough to type by hand, and picking two colors that look good together is where people stall out. So this one opens with a gallery of ready-made gradients you click to apply, plus a Shuffle button that builds a fresh one on demand. Pick Sunset, nudge the angle, swap a color, copy. Nothing is locked, every preset lands as fully editable stops you can push around however you like.
The rest is a real editor. Linear or radial, an angle slider with a live preview, as many color stops as you want, hex fields you type straight into, and a background: line that updates as you go, ready to copy straight into a stylesheet. Whatever the swatch shows is exactly what ships to your page. It all runs in your browser, so your colors never leave the page, nothing is uploaded, and there's no account.
How to use
- Grab a preset or shuffle. Click any swatch to load it, or hit Shuffle random for a color combination you didn't have to invent. Both drop in as normal editable stops, so a preset is a place to start, never a finished picture you're stuck with.
- Pick a type. Linear for a straight fade across the box in one direction, radial for color spreading out in rings from the center.
- Set the angle (linear only). Drag the slider from 0 to 360 and the label shows where you are. Radial hides the field, because a circle spreading from the middle has no single direction to point.
- Set your colors. Click the small color square for your operating system's native picker, or type a hex code into the field beside it if you already know the value.
- Place each stop. The number box is the position as a percent, 0 at the start and 100 at the end. Hit + Add stop and it lands at a sensible midpoint. The ✕ button removes one, and you always keep at least two.
- Copy or share it. The output box shows the full
background:declaration the whole time, stops already sorted. Click Copy CSS for the line, or Share to hand someone a link that reopens this exact gradient on their screen.
Start from a preset, then make it yours
Every bare gradient picker gets the same thing wrong. A gradient is maybe 80 percent color choice and 20 percent code, and those tools hand you the easy 20 percent while leaving the hard 80 to you. You end up dragging a color wheel in circles hoping two shades click. The preset gallery removes that step. Each one is a combination that already reads well, orange fading to gold for Sunset, two deep blues for Deep Sea, and one click loads the whole thing.
Presets on their own have their own downside, though, and that's the mistake the inspiration-only sites make. They show you something gorgeous and give you no way to touch it, so when the angle is wrong for your layout or one color runs a hair too bright, you're stuck. Ours opens every preset into editable stops. Rotate the angle, drag a stop from 50 to 70, retype a hex, tack on a fourth color. You get the strong starting point and the full editor together, and that pairing is what actually gets a gradient onto your page.
Shuffle is for the days nothing in the gallery fits. It doesn't just pick colors at random. It picks one base hue, finds a color that sits in harmony with it, then pairs them at an angle that reads cleanly. Hit it a few times, and the moment one lands close, edit it the rest of the way.
The angle points up, not right
CSS measures gradient angles in a way that catches nearly everyone the first time. 0deg points up, toward the top of the box, and the number grows clockwise. So 90deg runs left to right, 180deg top to bottom, 270deg right to left. The value describes the direction the fade travels, where the last color ends up.
The trap is that math class taught you 0 degrees points to the right. CSS doesn't play by that rule, and if your gradient looks rotated a quarter turn from what you pictured, this mismatch is almost always the reason, and the slider takes the question away entirely. Drag it, watch the swatch repaint, and whatever number gives you the direction you wanted is already in the output. CSS also takes keyword directions like to bottom right, which aims at the real corner even when the box isn't square, something a fixed degree value can't do.
Positions decide the gradient
The colors are the easy part. Where you place each stop is what decides whether the gradient comes out the way you pictured it. Each stop carries a percentage that pins its color to a spot along the path, and the browser fades across the gaps. Spread the stops wide and you get a long, lazy blend. Cluster two of them close, say 45 and 55, and the shift happens fast and tight in the middle with flat bands on either side. That's the real choice, deciding where the interesting part of the fade actually sits.
There's a failure the browser hides from you. If you hand-write a stop whose position is smaller than the one before it, the browser doesn't complain. It silently clamps that value up to match its neighbor, and your gradient renders wrong with no hint as to why. An easy mistake to make and a frustrating one to chase down later. This tool sorts every stop by position before it writes a single character, so you can punch the numbers in any order and the output stays valid every time.
Positions also unlock something most people don't realize a gradient can do, which is no blend at all. Give two stops the same position and the color snaps at that point instead of fading, a crisp edge. That's a hard stop, and it turns these functions into a way to paint stripes and flat bands with zero image files. Want a two-color split down the middle? Put your first color at 0 and 50, the second at 50 and 100, and it changes sharp dead center. The same trick builds progress bars and warning-tape backgrounds, all staying crisp at any size because there's no image to go fuzzy.
Frequently asked questions
What's the difference between the circle and ellipse radial shape?
The tool outputs circle, so the rings stay perfectly round no matter how wide or tall the element gets, which is what you want for glows and spotlights. ellipse, the browser's own default when you leave the shape out, stretches those rings to follow the box, so a wide element gets a wide oval spread. To get that version, copy the output and change circle to ellipse. Nothing else moves.
Does the Share link upload my gradient anywhere?
No. The Share button copies a plain link with the gradient packed into the address itself, the type, the angle, and every color stop. Open it and the tool rebuilds that exact gradient locally, so nothing about your colors ever touches a server. That also makes a link a bookmark. Paste it into your own notes and you have the setup saved for whenever you come back.
How do I make a conic gradient?
This tool builds linear and radial, not conic, but conic is worth knowing about. Instead of running along a line or out in rings, it sweeps color around a center point like the hand of a clock, which is what draws color wheels and pure-CSS spinners. Build your color list here, then wrap the stops in conic-gradient(from 0deg, ...) by hand. The color-stop portion reads the same across all three functions, so your values carry straight over.
Can I pour a gradient into text instead of behind it?
Yes, and it looks sharp on a large heading. Set the gradient as the element's background, then add background-clip: text, its -webkit-background-clip: text twin for Safari, and color: transparent. Keep the real text in the markup so it stays selectable and screen readers can read it, and set a solid fallback color for browsers that can't handle the clip. Reserve it for headings, not body copy.
Can I stack more than one gradient on a single element?
Yes. List several gradient functions in one background value separated by commas and they paint front to back, the first one on top, which only reads as layering because of transparency. As long as the upper layers have some (use rgba() or an 8-digit hex like #ffffff33), the ones underneath show through. Those soft mesh backgrounds on landing pages are usually a few radial gradients stacked at different positions, each fading to transparent at its edge.
Can I animate a gradient with a transition?
Not by transitioning the gradient itself, and this one catches people out. Browsers don't tween between two gradient values, so changing the stops in a :hover rule makes it snap rather than glide. The moves that genuinely slide: make the gradient bigger than the box and animate background-position, crossfade the opacity of two stacked layers, or register your colors as animatable custom properties with @property in newer browsers.
Why does my gradient show visible bands instead of a smooth fade?
That's banding, and it's the screen's fault more than your CSS. Displays with 8-bit color can only draw so many steps between two shades, so a gradient stretched over a large area, especially between two dark or similar colors, shows faint stripes where the steps become visible. The math is already smooth, so tweaking the stops won't clear it. Lay a very faint noise texture over the top to hide the steps, or pick end colors that sit further apart. It shows up worst on big hero backgrounds fading toward black.