Skip to content

CSS Gradient Generator

Preview
Color stops Click the bar to add a stop · drag to move

Stop 1 of 2

Type
Angle
°
CSS
.gradient {
  background: #577b27; /* fallback */
  background: linear-gradient(135deg, #a3e635 0%, #0b0f19 100%);
}
Presets One click to load, then tweak it

CSS Gradient Generator – Linear, Radial & Conic

What is a CSS Gradient?

A CSS gradient is a smooth blend between two or more colors, drawn by the browser itself. You don’t need an image file: one line of CSS gives you a background that stays sharp on every screen, loads instantly and is easy to change later.

Gradients are images in CSS, so they go in background or background-image, never in background-color. Each color in a gradient is called a color stop: a color plus the spot where it should be at full strength. This generator lets you drag those stops around and see the result live, then copy the finished CSS.

background: linear-gradient(90deg, #ff7e5f 0%, #feb47b 100%);

How to Use the Gradient Generator – Step by Step

Five quick steps. Everything happens in your browser and updates as you go.

Step 1 Start From a Preset (or Hit Random)

Click any of the presets under the tool to load it, or press Random until something catches your eye. You can change everything afterwards, so a preset is just a starting point.

Step 2 Pick the Type and Direction

Choose Linear, Radial or Conic. The settings below change with it:

  • Linear: drag the dial, use the slider, or click an arrow for a quick direction like “to right” or 45°.
  • Radial: pick a circle or an ellipse, how far it reaches (size), and click the 3×3 grid or use the sliders to move the center.
  • Conic: set the start angle with the dial and move the center the same way as radial.

Step 3 Edit the Color Stops

The bar under the preview shows every color stop as a little handle.

  • Add a stop: click anywhere on the bar. The new stop takes the color that was already there.
  • Move a stop: drag its handle (works with a mouse, a finger or a pen), or select it and use the arrow keys. Hold Shift to move 10% at a time.
  • Change the color: select a stop, then use the color picker, type a hex code like #a3e635, or lower the Opacity slider to fade it out.
  • Delete a stop: click Delete stop or press Delete. A gradient always keeps at least two stops.

Step 4 Try Repeating and “Apply to”

Tick Repeating to repeat your stops across the whole box (move the last stop below 100% to see it). Use Apply to above the preview to see your gradient on a box, on big text, or as a full-page background. The CSS output follows that choice.

Step 5 Copy the CSS

  • Copy CSS: copies the whole rule, with a solid fallback color line first for very old browsers.
  • Copy gradient: copies just the linear-gradient(…) part, handy when you already have a rule.
  • Output: switch between the background shorthand and background-image + background-color.
  • Your last gradient is remembered in this browser, so it’s still there next time.

Linear vs Radial vs Conic Gradients

All three use the same color stops. Only the shape of the blend changes. Here’s each one with the exact CSS that draws it:

Linear gradient

Colors change along a straight line. The angle sets the direction: 0deg goes up, 90deg to the right, 180deg down. Perfect for buttons, headers and page backgrounds.

background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);

Radial gradient

Colors spread out from a center point, as a circle or an ellipse. Move the center to make a soft spotlight or a glow behind a card.

background: radial-gradient(circle at 50% 35%, #fde68a 0%, #f59e0b 40%, #7c2d12 100%);

Conic gradient

Colors sweep around a center point, like the hands of a clock. Great for color wheels, pie charts and loading spinners.

background: conic-gradient(#ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);

Angles in a linear gradient

The angle points to where the gradient ends. 0deg means bottom to top, and it turns clockwise from there. You can also write keywords like to right, which is the same as 90deg.

0deg to top
90deg to right
180deg to bottom (default)
45deg to top right

Hard Stops, Stripes, Fades and Gradient Text

A few tricks that come up all the time:

Hard color stop

Two stops at the same position make the color jump instead of blend.

linear-gradient(90deg, #a3e635 0%, #a3e635 50%, #0b0f19 50%, #0b0f19 100%)

Repeating stripes

Hard stops that end at 10% and repeat, so they fill the whole box.

repeating-linear-gradient(45deg, #a3e635 0%, #a3e635 5%, #0b0f19 5%, #0b0f19 10%)

Fade to transparent

Same color, opacity going from 100% to 0%. Nice over photos.

linear-gradient(90deg, #6366f1 0%, rgba(99, 102, 241, 0) 100%)
Hello

Gradient text

The gradient shows only through the letters.

background-image: linear-gradient(90deg, #7f00ff 0%, #e100ff 50%, #f5576c 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;

Browser Support and Tips

Frequently Asked Questions

What is a CSS gradient?

A smooth blend between two or more colors that the browser draws for you. You write it as a background image, for example background: linear-gradient(90deg, #ff7e5f, #feb47b). There’s no image file to download, it stays sharp at any size, and you can change it with one line of CSS.

What is the difference between linear, radial and conic gradients?

A linear gradient changes color along a straight line, at the angle you choose. A radial gradient spreads out from a center point in a circle or an ellipse, like a glow. A conic gradient sweeps around a center point like the hands of a clock, which is great for color wheels and pie charts.

Should I use background or background-image for a gradient?

Both work, because a gradient is an image. The background shorthand is shorter but also resets background-color, background-size and the rest. Use background-image (plus background-color for the fallback) when the element already has other background settings you want to keep. Switch between both with the Output setting.

How do I make gradient text in CSS?

Put the gradient in background-image, then add background-clip: text (and -webkit-background-clip: text for Safari) and -webkit-text-fill-color: transparent. The background then only shows through the letters. Pick “Text” under Apply to and the tool writes all of that for you.

How do I make a hard line between two colors?

Give two stops the same position, for example #a3e635 50%, #0b0f19 50%. The color jumps instead of blending. That’s how stripes, flags and pie charts are made. In the tool, drag a stop exactly onto another or type the same position in the Position box.

What does a repeating gradient do?

repeating-linear-gradient (and the radial and conic versions) repeat your color stops over and over. It only makes a difference when the last stop is below 100%. For example stops at 0%, 5%, 5% and 10% give you thin stripes that fill the whole box. Try the Stripes preset.

Do CSS gradients work in all browsers?

Linear and radial gradients work in every browser in use today, with no -webkit- prefix needed. Conic gradients work in Chrome, Edge, Firefox and Safari since 2020–2021. The solid fallback line in the output covers anything older: browsers that don’t understand the gradient just show that color.

Is my gradient saved anywhere?

Only in your own browser. The last gradient you made is kept in localStorage so it’s still there when you come back. Nothing is uploaded, and there’s no account or signup.