CSS Gradient Generator

Design a gradient visually and get the CSS code. Choose two colors, switch between linear and radial, adjust the angle, and copy the background property straight into your stylesheet.

gradient-generator · runs locally

What this CSS gradient generator does

Writing linear-gradient() by hand means guessing at angles and hex values, saving, and reloading until it looks right. This generator removes the loop: you see the gradient live as you pick colors and drag the angle slider, and the matching CSS updates in real time. When it looks right, one click copies a background declaration you can paste into any stylesheet, style attribute or CSS-in-JS block.

The output uses plain, universally supported syntax — no vendor prefixes needed. linear-gradient and radial-gradient have worked in every browser since roughly 2013.

How to create a CSS gradient

  1. Choose Linear or Radial.
  2. Pick a start and end color with the color swatches.
  3. For linear gradients, drag the angle slider until the direction feels right.
  4. Copy the generated CSS into your project.

Tips for gradients that look professional

The most common gradient mistake is spanning two unrelated hues, which produces a muddy gray midpoint. Gradients read as intentional when the two colors share a family — two blues, or a hue and its warmer neighbor. If you need help finding companion colors, generate a scheme with the Color Palette Generator and feed two of its swatches into this tool. Subtle angle choices (135deg rather than 90deg) also make backgrounds feel less templated.

Frequently asked questions

What is the difference between linear and radial gradients?

A linear gradient blends colors along a straight line at an angle you choose — 0deg points up, 90deg points right. A radial gradient blends outward from a center point in circles or ellipses. Linear suits backgrounds and buttons; radial suits spotlights and vignettes.

How do gradient angle degrees work in CSS?

The angle sets the direction the gradient travels toward: 0deg goes bottom-to-top, 90deg left-to-right, 180deg top-to-bottom, and 135deg diagonally toward the bottom-right. Classic keywords like 'to right' equal 90deg.

Can I add more than two color stops?

Yes — CSS supports any number. Take the generated code and add stops by hand, for example linear-gradient(135deg, #0e7c86 0%, #7fb3a3 50%, #e8a33d 100%). Each stop is a color followed by its position along the gradient line.

Are CSS gradients better than gradient images?

Almost always. Gradients render natively at any resolution with zero download weight, stay crisp on retina screens, and can be changed by editing one line of CSS instead of re-exporting an image.