Skip to content
Hex Color Picker

CSS Gradient Generator

Add two to five color stops, set where each one sits, and choose a linear, radial or conic gradient. The preview updates live and the CSS is ready to copy into any stylesheet.

#1E90FFexactly dodgerblue

This is the CSS color dodgerblue #1E90FF

Use 3 or 6 digits, for example #1E90FF or 19F

For example rgb(30, 144, 255) or 30 144 255

For example hsl(210, 100%, 56%)

For example cmyk(88%, 44%, 0%, 0%)

Gradient

Type
background: #1E90FF;
background: linear-gradient(90deg, #1E90FF 0%, #8A2BE2 100%);

Recent colors

Colors you pick appear here. They stay on this device.

By the Hex Color Picker Team. Updated

How to build a gradient

  • Choose the type: linear runs along a line, radial spreads from the center outward, and conic sweeps around the center like a color wheel.
  • Edit each stop's color with its hex box or color swatch, and set its position from 0% to 100%.
  • For linear and conic gradients, set the angle. 90 degrees runs left to right and 180 runs top to bottom.
  • Add up to five stops, remove any you don't need, then copy the CSS.

What the output looks like

The tool produces a standard background declaration, for example background: linear-gradient(90deg, #1E90FF 0%, #8A2BE2 100%);. It uses the plain, widely supported gradient functions, so it works in every current browser without prefixes. A solid fallback color line is included first, which older or restricted environments will use if gradients aren't supported.

Tips for smoother gradients

  • Stops with similar lightness blend smoothly. Pairing very dark and very light stops can leave a visible grey band in the middle.
  • Two stops at the same position make a hard edge instead of a blend, which is how stripes are drawn in CSS.
  • If text sits on the gradient, check contrast against both the lightest and darkest parts.
  • Large, subtle gradients can show banding on some screens. A very small amount of noise or a slightly wider color difference usually hides it.

How the angle maps to direction

  • 0 degrees points up, so the first stop is at the bottom and the last at the top.
  • 90 degrees runs left to right, 180 degrees runs top to bottom, and 270 degrees runs right to left.
  • For a conic gradient, the angle sets where the sweep starts, measured clockwise from the top.
  • Radial gradients ignore the angle, because they spread evenly from the center.

Linear, radial and conic in short

Use linear gradients for backgrounds and buttons, radial gradients for spotlights and glows, and conic gradients for pie-chart style graphics and color wheels. All three accept the same list of stops, so you can switch type without rebuilding your colors.

Common questions

How do I make a gradient with CSS?

Set the background property to a gradient function, for example background: linear-gradient(90deg, #1E90FF 0%, #8A2BE2 100%). This tool writes that line for you.

How many color stops can I use?

The tool supports two to five stops. CSS itself allows more, so you can add further stops by hand to the copied code.

More color tools