Skip to content
Free design tool

CSS gradient generator

Write your color stops one per line and get CSS you can paste straight into a stylesheet. It suits developers and designers who want clean gradient code without dragging sliders.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result

Your input

37 characters

Type
Degrees, for linear and conic. 90 runs left to right
Radial shape
Fallback color

Result

/* Linear gradient at 90deg, 3 stops. The first line is a solid fallback. */
background: #ff6347;
background: linear-gradient(90deg, #ff6347 0%, #ffd700 50%, #4169e1 100%);

The short answer

A CSS linear gradient is written linear-gradient(angle, color stop, color stop), and the browser blends the colors between the stops. An angle of 90deg runs left to right, and each stop position is a percentage along the gradient line.

Formulabackground: linear-gradient(<angle>, <color> <position>, <color> <position>, ...)

Worked exampleThe stops #ff6347 at 0%, #ffd700 at 50% and royalblue at 100% at 90deg give linear-gradient(90deg, #ff6347 0%, #ffd700 50%, #4169e1 100%), plus a solid #ff6347 fallback line.

Example

Input
#ff6347 0%
#ffd700 50%
royalblue 100%
Result
/* Linear gradient at 90deg, 3 stops. The first line is a solid fallback. */
background: #ff6347;
background: linear-gradient(90deg, #ff6347 0%, #ffd700 50%, #4169e1 100%);

How to use the css gradient generator

  1. Enter one color stop per row with a Color and an optional Position, such as tomato and 50%.
  2. Choose a Type: Linear, Radial or Conic. Then set the Angle, or the Radial shape for radial gradients.
  3. Pick a Fallback color: First stop or Average. Results update as you type, and Run also works.
  4. Press Copy result to paste the background lines into your CSS.

How it works

You need 2 to 20 stops. Each line is any color the color converter accepts, followed by an optional position from 0% to 100%.

Positions are percentages, with or without the % sign, and must not go backward. Every color is checked and written as hex in the output.

Linear gradients use the angle, where 90 runs left to right. Conic gradients start from the angle, and radial gradients use an ellipse or circle from the center.

A short comment comes first. The first background line is a solid color for browsers that cannot draw gradients. It is either the first stop or the plain average of the stop colors, and any translucent stop is blended over white first so the fallback is always opaque.

Everything runs in your browser. Your input is not uploaded or stored. If you use Copy link, what you entered is placed in the link.

Questions and answers

What does the angle mean in a linear gradient?

0deg points up, 90deg points right, 180deg points down and 270deg points left. The gradient runs in that direction from the first stop to the last.

Why add a fallback background color?

If a browser or email client cannot draw the gradient, it skips that line and uses the solid color above it, so text stays readable.

Can I use transparent colors?

Yes. Colors with alpha, such as rgb(255 0 0 / 50%), are kept as 8 digit hex codes in the gradient.

Last updated November 1, 2026. Maintained by SnowRock. How our tools work

All 220 SnowRock tools