Tools / CSS Gradient Generator

CSS Gradient Generator.

Build linear, radial and conic CSS gradients with a live preview, OKLCH interpolation and Tailwind output.

Runs in your browser
CSS

            
Tailwind

            

About CSS Gradient Generator

The CSS Gradient Generator lets you design a background gradient visually and copy production-ready CSS. Choose a linear, radial or conic gradient, set the angle or center position, and list your color stops, one per line, each with an optional position such as 40% or 120px. The preview updates as you type, and the output contains a solid background-color fallback followed by the background-image declaration, plus a Tailwind arbitrary-value class like bg-[linear-gradient(135deg,#f97316_0%,#8b5cf6_100%)]. Modern browsers can interpolate gradients in the OKLAB and OKLCH color spaces with the "in oklch" syntax; switching to it avoids the dull gray band you get in the middle of an sRGB blend between complementary colors such as blue and yellow. Repeating gradients turn a few stops into stripes or rings. For example, orange to pink to violet at 135 degrees in OKLCH makes a vivid hero background. Common mistakes are using a 0deg angle and expecting left to right (0deg points up; 90deg is left to right), forgetting the fallback color for text contrast while the image loads, and placing stops out of order, which creates hard edges. Any CSS color works in the stops, including hex, rgb(), hsl(), oklch() and names. The generator runs entirely in your browser.

How to Use

  1. Pick the gradient type and adjust the angle or center.
  2. Edit the color stops, one color (and optional position) per line.
  3. Copy the CSS or the Tailwind class from the result panel.

Frequently Asked Questions

Which direction is 0 degrees?

In CSS, 0deg points to the top and angles go clockwise, so 90deg runs left to right and 180deg (the default) top to bottom.

What does "in oklch" change?

It interpolates in a perceptual color space, which keeps mid-tones vivid instead of passing through gray. Browsers without support ignore the whole declaration, so keep the fallback color.

How do I make hard stripes?

Give two neighbouring stops the same position, for example "red 50%" and "blue 50%", or use the repeating option.

Does this upload anything?

No. The CSS is generated in your browser.

Related Tools