CSS Gradient Generator: Design It, Copy the Code
Build linear, radial and conic gradients with a live preview, up to 10 colour stops and an exact angle. Copy the CSS or a Tailwind class in one click.
Rate this toolGradient Studio
Type · angle · colour stops · CSS or Tailwind
Build your gradient
Type
Colour stops 3
- 0%0%100%
- 0%50%100%
- 0%100%100%
Add up to 10 stops. Click a preset below to replace the current gradient.
Presets
Live preview
background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);- Gradient types
- 3Gradient types
- Colour stops, max
- 10Colour stops, max
- Ready-made presets
- 8Ready-made presets
- Designs uploaded
- 0Designs uploaded
Finish your colour scheme
Tools that pick up where this one leaves off.
- Build a palette around itPull the rest of your scheme from these stops · Color Picker / Palette Generator
- Pick colours from an imageMatch a gradient to a photo or screenshot · Color Picker from Image
- Frame a screenshot on a gradientA polished post image for X, LinkedIn or Instagram · Screenshot to Social Post
A CSS gradient in three steps
From an idea to a line of CSS you can paste, with a live preview the whole way.
- STEP 01
Pick a type
Linear for a straight blend, radial for a glow from a point, conic for a sweep around one.
Or start from a preset - STEP 02
Set the colours
Pick colours, drag each stop to its position and set the angle.
2 to 10 stops - STEP 03
Copy the code
Copy a CSS background rule or a Tailwind class and paste it into your project.
One click
How to use this gradient generator
What you see in the preview is your browser rendering the exact CSS you are about to copy.
- 1
Start from a preset
Pick one of the eight presets, or keep the default and change it. Every preset can be edited.
- 2
Adjust the stops
Use the swatch or type a hex value, then drag the slider to place the stop from 0% to 100%.
- 3
Set the direction
Linear and conic gradients take an angle. Radial and conic gradients take a centre point.
- 4
Check it full screen
Open the fullscreen preview to see banding or harsh edges, then copy the CSS or Tailwind class.
What makes a gradient look good
Four habits that separate a polished gradient from a muddy one.
Neighbours blend best
Colours close on the colour wheel blend cleanly. Opposites can pass through a dull grey in the middle.
- Two or three hues
- Add a middle stop
- Avoid grey midpoints
Keep text readable
Text on a gradient has to read at the lightest and the darkest point, not just the average.
- Check both ends
- Add a dark overlay
- Keep text off busy areas
Fewer stops
Most good gradients use two or three stops. Each extra stop is another place for it to look busy.
- Start with two
- Add stops on purpose
- Space them evenly
Match the shape
A wide hero suits a gentle angle. A square card suits a diagonal or a radial glow.
- Wide: 90 to 135°
- Square: radial
- Round: conic
Linear, radial and conic gradients
Three CSS functions, three different shapes of blend.
Linear
Colours change along a straight line at the angle you set. 0deg points up and angles turn clockwise.
- Backgrounds
- Buttons
- Section dividers
Radial
Colours spread out from a centre point, as a circle or an ellipse that follows the box's shape.
- Glows
- Spotlights
- Soft vignettes
Conic
Colours sweep around a centre, starting at the top and turning clockwise from the angle you set.
- Pie and donut charts
- Colour wheels
- Spinner rings
CSS or Tailwind
Copy a background rule for any stylesheet, or a Tailwind arbitrary-value class with the same gradient.
- background: ...;
- bg-[...] class
- Same result
Who reaches for a gradient generator
Same tool, different reasons.
Front-end developers
Writing gradient syntax by hand means guessing angles and stop positions. A preview removes the guessing.
Designers
Hand developers the exact CSS instead of a screenshot, so the build matches the design.
Marketers
Branded backgrounds for landing pages and banners, without waiting for a designer.
Students
Change one value and watch the preview to learn how angles, stops and shapes work.
How CSS reads a gradient
These come from the CSS specs as documented on MDN. They explain most surprises in the preview.
The rules
What browsers do with the values you give.
- 0deg points up; angles turn clockwise
- No direction means to bottom (180deg)
- Radial shape is ellipse unless you say circle
- Radial and conic centres default to center
- Two stops at one position make a hard line
Keywords as angles
The direction keywords and the angle each one equals.
Common mistakes
These make a gradient look wrong in the browser.
- Using background-color for a gradient
- Expecting 0deg to point right
- Opposite colours with no middle stop
- Light text over the light end
- Too many stops in a small box
Keeping gradients consistent across a site
One gradient is easy. A dozen that still look like one brand takes a little system.
- 1
Use colour variables
Put the stop colours in CSS custom properties, so a brand change is one edit.
- 2
Name your gradients
Keep a short list such as hero, card and button, instead of a new gradient on every page.
- 3
Keep the source CSS
Save the copied line in your design notes, so anyone can rebuild or tweak it later.
- 4
Check dark mode
A gradient made for a white page can glare on a dark one. Test both before you ship.
This generator vs writing it by hand vs a design tool
Use each for what it does best.
| Feature | CleverTools generator | By hand | Design tools |
|---|---|---|---|
| Live preview | ✓ As you change it | ✗ Save and reload | ✓ Yes |
| Ready-to-paste CSS | ✓ One click | ✓ You wrote it | Export varies |
| Tailwind class | ✓ Built in | Write it yourself | ✗ Rarely |
| Conic gradients | ✓ Yes | ✓ Yes | Varies |
| Account needed | ✓ Never | ✓ No | Usually |
| Cost | ✓ Free | ✓ Free | Free to paid |
Need colours that go together? Build a set with the Color Palette Generator and use them as stops.
Pro tips for better gradients
Small changes that make a gradient look designed, not default.
Add a middle stop
Between two far-apart hues, a middle stop keeps the blend bright instead of muddy.
Try 135 degrees
A diagonal from top left to bottom right reads as natural light on most layouts.
Circle for even glows
An ellipse stretches with the box. Pick circle when you want the glow perfectly round.
Hard stops for charts
Give two stops the same position for a sharp edge: the basis of a pure-CSS pie chart.
Test with real text
Put your actual headline on the gradient. Contrast that looks fine empty can fail with text.
Check small screens
A gradient that spans a wide desktop hero gets compressed on a phone. Look at both.
Subtle on buttons
Buttons look best with two close shades. Strong gradients compete with the label.
Start from a preset
A preset is a quick way to see a good spread of stops, then swap in your colours.
A gradient is an image in CSS, so it belongs in background or background-image. Put it in background-color and the browser ignores the whole line.
Angle or keyword? How to set a linear gradient's direction
Both work in every modern browser. They differ in precision and in how they behave on boxes that aren't square.
An angle
Any value from 0 to 360 degrees. 0deg points up and the angle turns clockwise, so 90deg runs left to right. Exact, and the same on every box.
Best when you want one precise direction
A keyword
to top, to right, to bottom and to left equal 0, 90, 180 and 270 degrees. Corner keywords such as to top right change their angle with the box's shape.
Best when the gradient should follow the corners
What people build with this generator
Six common places a gradient earns its spot.
Hero backgrounds
A soft linear gradient behind a landing page headline.
Buttons
Two close shades that give a call to action some depth.
Glows and spotlights
A radial gradient that pulls the eye to a product shot.
CSS pie charts
A conic gradient with hard stops, with no chart library.
Brand backdrops
Social cards and banners in your brand colours.
Learning CSS
See exactly what each value in the syntax changes.
Matching a colour from a photo? Use the Color Picker from Image.
Frequently asked questions
Quick answers about gradient types, stops and browser support.
What gradient types are supported?
Can I add multiple color stops?
Does it generate valid CSS?
Is this free?
What people say
Reviews from people who used this tool.
Loading reviews…
Popular presets
Jump to a version of this tool already set up for a specific need.
More free developer tools
Free, with no sign-up, just like this one.
- Free toolFavicon GeneratorTurn any image into the full favicon set - six standard sizes plus the HTML meta tags ready to paste, generated locally in your browser.Try it now
- Free toolHash GeneratorGenerate MD5, SHA-1, SHA-256, SHA-512 hashes from text or filesTry it now
- Free toolCron Expression GeneratorBuild, preview, and copy cron expressions visually with presets and next run time previewTry it now
- Free toolCSS Beautifier & FormatterBeautify, format, or minify CSS code instantly in your browser.Try it now
- Free toolBase64 Encoder / DecoderEncode text to Base64 or decode Base64 strings instantly in your browserTry it now
- Free toolJWT DecoderDecode and inspect JSON Web Tokens - view header, payload, expiry, and claims instantlyTry it now