๐Ÿ”’ Runs in your browser โ€” nothing is uploadedโœ“ Free, no signup

CSS Gradient Generator

Build linear and radial gradients visually โ€” pick colors, drag stops and set the angle โ€” then copy ready-to-use CSS.

CSS

background: #6D28D9;
background: linear-gradient(135deg, #6D28D9 0%, #EC4899 100%);

The first line is a solid fallback for very old browsers.

Type

Color stops

  • 0%
  • 100%

Presets

When should you use the CSS Gradient Generator?

  • Designing a hero or button background without an image
  • Matching a gradient from a design file in CSS
  • Trying color combinations quickly with live preview

How to use the CSS Gradient Generator

  1. 1

    Pick a type

    Choose linear for a straight blend or radial for a circular one.

  2. 2

    Set the direction

    Drag the angle slider for linear gradients, or choose circle or ellipse for radial.

  3. 3

    Edit color stops

    Change colors, drag positions, and add or remove stops. Or start from a preset.

  4. 4

    Copy the CSS

    Click Copy CSS and paste it into your stylesheet.

Examples

Two-color diagonal gradient

Settings

Type: linear, angle 135ยฐ
Stops: #6D28D9 0%, #EC4899 100%

CSS

background: #6D28D9;
background: linear-gradient(135deg,
  #6D28D9 0%, #EC4899 100%);

Common errors and how to fix them

The gradient doesn't show on my element
The element needs a size. Give it a height (or content) โ€” an empty element with no height has nothing to paint.
There's a hard line instead of a smooth blend
Two stops are at the same position. Move them apart for a smoother transition.
Related tools:ย Color Picker & Converter ยท PX to REM Converter ยท CSS Minifier

More from Design & Color

Free tools that run in your browser โ€” no signup, nothing uploaded.

CSS Gradient Generator FAQ

Choose linear or radial, set the angle or shape, pick your color stops and copy the generated CSS. Paste it into the background property of any element.

A linear gradient blends colors along a straight line at the angle you choose. A radial gradient spreads out from the center as a circle or ellipse.

Each stop sets where a color is fully applied along the gradient, from 0% (start) to 100% (end). Moving two stops close together makes a sharper transition.

It's a fallback. Browsers that can't render the gradient use the solid color instead. All modern browsers support CSS gradients, so it's rarely needed but harmless.

Yes. Use an arbitrary value such as bg-[linear-gradient(135deg,#6D28D9_0%,#EC4899_100%)] โ€” replace spaces with underscores โ€” or put the CSS in a custom class.

No. Gradients are drawn by the browser, so they're usually lighter than an image and stay sharp at any size.