Skip to content

CSS Gradient Generator

Blend colors into a gradient and copy the CSS.

  • 100% Free
  • No Sign Up
  • Works in Your Browser

How to use the gradient generator

Three steps, all in your browser.

  1. 1

    Start generating

    Get a fresh set of colors, or start from a color you already have.

  2. 2

    Tweak and lock

    Adjust any color, lock the ones you like and generate again.

  3. 3

    Copy the codes

    Copy any color code in one click, or share the page link.

CSS Gradient Generator: what to know

The gradient generator builds CSS gradients from two or more colors. Pick a linear or radial gradient, set the angle and the position of each color stop, and see the result live. The CSS code updates as you go and can be pasted straight into a background property.

Gradients between distant hues can turn gray in the middle, because browsers blend in sRGB by default and the straight line between, say, blue and yellow passes through gray. Modern CSS can interpolate in other color spaces: 'linear-gradient(in oklch, ...)' keeps the middle colorful by traveling around the hue wheel instead.

Smooth gradients also need enough contrast with any text on top of them. Check text against both the lightest and the darkest part of the gradient, not just one end.

Popular uses

  • Hero and banner backgrounds for websites
  • Buttons, cards and badges with a subtle depth
  • Social media graphics and presentation slides
  • Overlay gradients that make text readable over photos

Tips for the best result

  • Two close hues (like pink to orange) look more natural than opposite hues.
  • Add a third stop in the middle to avoid a muddy center between complementary colors.
  • For text over a photo, a transparent-to-dark gradient overlay is more reliable than a shadow.

Read how JustYourPalette works, browse named colors and curated palettes, and see our privacy details. Colors you enter and images you open are processed in your browser and are never sent to our server.

Frequently asked questions