Skip to content

CSS Gradient Generator

Blend colors into a gradient and copy the CSS.

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

Browsers blend gradients in sRGB by default, and the straight line between two opposite hues (like blue and yellow) passes through gray. Adding a middle color stop, or interpolating in OKLCH or OKLab, keeps the middle bright.

linear-gradient() and radial-gradient() work in every current browser. Interpolation hints such as 'in oklch' are newer and are supported in current versions of Chrome, Edge, Safari and Firefox.

No. Every tool runs in your browser, so the colors you enter and any image you open are processed on your device and are not sent to our server or stored. Reloading or closing the page clears them.

Yes. Every tool is free with no sign-up and no limits on use. Clearly labeled ads keep it that way.

Yes. Colors and color codes aren't owned by anyone, so you can use anything you make here in personal and commercial projects. Brand colors may still be protected as part of a trademark.