Home/Tools/Colors/Gradient Generator
Colors · Generator

Gradient Generator

Create beautiful CSS gradients with live preview. Linear, radial, and conic gradients supported.

Gradient Type

Angle

135°

Color Stops

0%
50%
100%

Preview

Generated CSS
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the CSS Gradient Generator?

Build linear, radial, and conic CSS gradients visually with multi-stop colour control and a live preview. Copy the code straight into your stylesheet.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the CSS Gradient Generator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Choose your gradient type

Select Linear, Radial, or Conic from the type tabs. The preview and available controls update immediately.

2

Set colours and stop positions

Click any colour stop on the gradient bar to open the picker. Drag stops to reposition. Add up to 10 stops with the Add Stop button.

3

Copy the CSS output

The gradient() function updates in real time. Click Copy CSS and paste directly as a background value.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
.hero {
  background: linear-gradient(135deg, #6C2EF5 0%, #f97316 100%);
}

/* Radial example */
.card {
  background: radial-gradient(circle at 30% 50%, #6C2EF5 0%, #1e1b4b 80%);
}

/* Multi-stop */
.banner {
  background: linear-gradient(
    90deg,
    #6C2EF5 0%,
    #8b5cf6 40%,
    #f97316 100%
  );
}

Paste as the background or background-image value on any element. No prefixes needed for Chrome 26+, Firefox 16+, Safari 7+.

Copy & paste

Ready-to-use CSS patterns

Drop any of these straight into your project — no modifications needed.

Subtle hero background

Soft diagonal fade — works on any section background without competing with text.

styles.css
.hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9d5ff 100%);
}

Keep contrast low when text sits on the gradient.

Vibrant CTA button

High-energy purple-to-orange — use for primary action buttons only.

styles.css
.btn-primary {
  background: linear-gradient(90deg, #6C2EF5, #f97316);
  color: #fff;
  border: none;
}

Test text contrast on both ends of the gradient.

Dark mode card

Deep radial glow for cards on dark backgrounds.

styles.css
.card-dark {
  background: radial-gradient(
    ellipse at top,
    #1e1b4b 0%,
    #0f0f1a 70%
  );
}

Combine with a subtle border for depth.

Gradient text fill

Apply a gradient directly to text using background-clip.

styles.css
.heading-gradient {
  background: linear-gradient(90deg, #6C2EF5, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

Supported in Chrome 4+, Firefox 3.6+, Safari 3+.

Pro tips

Pro tips for better results

Transparent stops need rgba, not hex

Use rgba(108,46,245,0) not #6C2EF500. Some browsers render the hex transparent form with a grey fringe at the fade edge.

Limit to 3-4 colour stops

Gradients with five or more stops usually look indecisive. If you need complex colour, consider a CSS pattern background instead.

Test on both light and dark page backgrounds

A gradient that looks perfect on white can disappear in dark mode. Use CSS custom properties to flip gradient values with a data-theme attribute.

Gradients cannot be transitioned directly

background-image: linear-gradient() is not animatable with CSS transition. Animate background-position on an oversized gradient, or transition opacity between layered pseudo-elements.

When to use a solid colour instead

If body copy sits on the gradient, keep the lightness difference below 10% or switch to a solid. High-contrast gradients behind text hurt readability on small screens.

FAQ

Frequently asked questions

Yes. Switch to the Conic tab to generate conic-gradient() code. Conic gradients are supported in Chrome 69+, Firefox 83+, and Safari 12.1+, covering roughly 93% of current browser usage.
Use border-image with your gradient: border-image: linear-gradient(90deg, #6C2EF5, #f97316) 1. This does not support border-radius. For rounded gradient borders, use the pseudo-element background-clip technique.
Not directly - background-image is not animatable with transition. The standard workaround is to animate background-position on an oversized gradient background, giving the illusion of movement.
No. The generator runs in your browser. Your gradient configuration is never sent to a server or stored in any database. Closing the tab clears it.
linear-gradient transitions colours along a straight line at an angle. conic-gradient transitions colours around a centre point, like a pie chart or colour wheel. radial-gradient radiates outward from a point in an ellipse or circle.

From the blog

Read more