Skip to content
ToolZone

Gradient Generator

Visually build a CSS gradient with multiple color stops and a chosen direction, then copy the resulting gradient code for your design.

Runs in your browser. Nothing you enter or upload leaves your device.

Color stops
#2563eb0%
#06b6d4100%
Presets
background: #2563eb;
background: linear-gradient(90deg, #2563eb 0%, #06b6d4 100%);

Keyboard shortcuts

Run the main action
⌘ / Ctrl + Enter
Copy the result
⌘ / Ctrl + Shift + Enter
Download the result
⌘ / Ctrl + S
Paste a file or image into file tools
⌘ / Ctrl + V
Search all tools
⌘ / Ctrl + K
Show these shortcuts
?

You can also drop files anywhere on the page.

About the Gradient Generator

Gradient Generator makes smooth gradient backgrounds for a website, slide or mockup. Start from a preset or the Random button, add as many color stops as you like, choose linear, radial or conic, and copy the CSS or a link that reopens the same gradient.

How it works

The tool writes a CSS gradient function from your settings. Linear gradients use an angle (0deg runs bottom to top, 90deg left to right), radial gradients use a circle or ellipse shape and a center position, and conic gradients sweep colors around a center point starting from the chosen angle. Each color stop has a position from 0% to 100%, and stops are listed in order of position.

Ticking Repeating switches to repeating-linear-gradient (or the radial and conic versions), which tiles the pattern once the last stop is reached, useful for stripes. The copied CSS includes a solid background color first as a fallback, then the gradient.

How to use

  1. 1

    Pick Linear, Radial or Conic, or start from a preset or the Random button.

  2. 2

    Set each color stop's color and drag its position; use Add stop for more colors.

  3. 3

    Adjust the angle, or the shape and center for radial and conic gradients.

  4. 4

    Click Copy to copy the CSS and paste it into your stylesheet.

Worked examples

Default blue to purple

A quick blue-to-purple hero background.

Input
Linear, 90°, stops #2563eb at 0% and #7c3aed at 100%
Result
background: #2563eb; background: linear-gradient(90deg, #2563eb 0%, #7c3aed 100%);

Diagonal sunset

A warm card background running from top-left to bottom-right.

Input
Linear, 135°, stops #f97316 at 0% and #db2777 at 100%
Result
background: #f97316; background: linear-gradient(135deg, #f97316 0%, #db2777 100%);

Spotlight effect

A soft glow in the middle of a dark panel.

Input
Radial, circle at center, #334155 at 0% and #0f172a at 100%
Result
background: #334155; background: radial-gradient(circle at center, #334155 0%, #0f172a 100%);
Limitations
Colors are fully opaque; edit the copied CSS to use rgba() or transparent stops. Stop positions are whole percentages; pixel positions and color hints aren't offered. Interpolation color spaces such as 'in oklch' aren't set.
Assumptions
The CSS will be used as a background on an element with a visible size. Target browsers support standard (unprefixed) CSS gradients, as all current browsers do.
Privacy
The gradient is created in your browser and nothing is uploaded or stored.

Frequently asked questions

How many colors can I add to a gradient?+

As many as you like. Click Add stop to add a color between the two furthest-apart stops, then adjust its color and position.

Can I preview the gradient before copying the code?+

Yes. The preview box at the top updates as soon as you change a stop, the type or the angle.

Which direction does 0deg go?+

In CSS, 0deg runs from bottom to top, 90deg from left to right and 180deg from top to bottom.

What's the difference between linear and radial gradients?+

A linear gradient changes color along a straight line at a set angle. A radial gradient spreads outward from a center as a circle or ellipse, and a conic gradient sweeps around a center point.

Do CSS gradients slow down my page?+

No. They're drawn by the browser, need no image download, and scale cleanly to any screen size.

Related tools