Skip to content
ToolZone

CSS Gradient Generator

Visually design a linear or radial CSS gradient with multiple color stops, then copy the generated gradient code straight into your project.

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 CSS Gradient Generator

The CSS Gradient Generator builds linear, radial and conic gradients with as many color stops as you like and shows them in a large preview while you adjust. When it looks right, copy a complete background declaration, or copy 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 left-to-right blend

A blue-to-purple banner background.

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

Diagonal fade

A card that fades from top-left to bottom-right.

Input
Linear, stops #f59e0b at 0% and #ef4444 at 100%, angle 135
Result
background: #f59e0b; background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

Radial spotlight

A soft glow behind a hero headline.

Input
Radial, circle at center, #ffffff at 0% and #0f172a at 100%
Result
background: #ffffff; background: radial-gradient(circle at center, #ffffff 0%, #0f172a 100%);

White fills the center and fades out to dark navy at the edges.

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 gradient is used as a CSS background on a block element. Target browsers support standard unprefixed gradient syntax, as all current browsers do.
Privacy
The preview and CSS are generated in your browser; nothing is uploaded or saved.

Frequently asked questions

What's the difference between a linear and radial gradient?+

A linear gradient transitions colors along a straight line at a chosen angle. A radial gradient spreads outward from a center point as a circle or ellipse, and a conic gradient sweeps around the center like a clock hand.

Can I add more than two colors to a gradient?+

Yes. Click Add stop for as many colors as you like and drag each one's position.

Which direction does 0deg point?+

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

Do I need vendor prefixes like -webkit-?+

No. All current browsers support the standard linear-gradient() and radial-gradient() syntax that this tool outputs.

Can I use the gradient on text or borders?+

The output is a background value. You can reuse the gradient function itself with background-clip: text for text, or with border-image for borders, by editing the copied CSS.

Related tools