CSS Gradient Generator

Your input stays in your browser and is never sent.

Build linear, radial and conic gradients by moving the angle and color stops, then copy the CSS. The CSS shown is exactly what the preview uses.

  1. Enter
  2. See the result
Start from a preset

This is exactly the CSS the preview uses. Paste it as is.

What is the CSS gradient generator?

The CSS gradient generator builds the CSS for a background gradient from a type, an angle and your colors. It supports linear, radial and conic gradients.

Add or move a color stop and the preview and the CSS on the right change at once, so you can judge the look while you work instead of rewriting the CSS by hand.

The finished CSS is a single line — copy it and paste it into your stylesheet. No sign-up or login, and it's free.

How to use the CSS gradient generator

  1. Choose a typePick linear, radial or conic. You can also start from a preset.
  2. Set colors and positionsChoose each color and give it a position from 0 to 100%. You can add or remove colors.
  3. Copy the CSSCopy the CSS on the right and paste it into the background of your stylesheet.

Features of SOKUFU's CSS gradient generator

Three gradient types
Linear, radial and conic. A conic gradient turns around its center like a pie chart.
Up to 8 colors
Use 2 to 8 color stops. Positions can be set precisely by number.
Start from a preset
Sunset, ocean, mint, night sky and rainbow presets are included. Tweak the one you like.
One line to paste
The output looks like "background: linear-gradient(...);", ready for your stylesheet.
Runs in your browser
Nothing you enter is ever sent to a server.
Works on phones
The layout adapts to your screen, so it works on phones and tablets too.

How gradient CSS is written

A linear gradient is written linear-gradient(angle, color position, color position, ...). 0deg points up and the angle grows clockwise, so 90deg runs left to right and 180deg runs top to bottom.

A radial gradient is radial-gradient(circle, color position, ...) and changes color from the center outward. A conic gradient is conic-gradient(from angle, color position, ...) and turns clockwise starting from the top.

Using the same color at the first and last stops hides the seam in a conic gradient.

Related tools to use with the CSS gradient generator

CSS gradient generator FAQ

Which direction is 0 degrees?

0 degrees points up and the angle grows clockwise. 90 degrees points right and 180 degrees points down.

How many colors can I add?

Up to 8. You can't go below 2 colors.

Can I use the CSS as it is?

Yes. It is the same CSS the preview uses, so pasting it into background gives the same look.

How can I enter colors?

As HEX (#6366F1), rgb(), hsl() or a basic color name such as red or blue. The output is normalized to #RRGGBB.

Are my gradient colors and settings sent to a server?

No. The preview and the CSS text are both built in your browser. The colors and angle you pick are not sent anywhere.