My Tool Studio
CSS

CSS Gradient Generator

Gradients went from design trend to baseline expectation, and writing the syntax by hand is still fiddly. This css gradient generator builds the code visually: pick Linear, Radial, or Conic, drag the angle slider, and set up to six color stops with exact percentage positions. The preview repaints on every change, so you see the blend before you ship it. It works as a linear gradient generator for buttons and hero sections, and as a gradient code generator for conic pie charts or radial spotlights. When a designer hands you a mockup with a smooth two-color fade, you can match it here in under a minute and copy one clean background property.

Always freeNo sign upRuns in your browser
%
%
background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);

How to use

01

Choose Linear, Radial, or Conic

Switch between the three tabs at the top. Linear and conic types show an angle slider from 0 to 360 degrees; radial always draws a circle from the center.

02

Set your color stops

Each stop has a color picker, a hex field, and a position input in percent. Click + Add color stop for up to six, or Remove to drop one back to a minimum of two.

03

Copy the CSS

The full background property appears in the code box below the preview. Hit the copy button and paste the declaration straight into your stylesheet.

Why CSS Gradient Generator

Common questions

How many color stops can a gradient have in this tool?
Up to six, each with its own hex value and a position from 0 to 100 percent. Two stops at 0 and 100 give an even blend across the whole element. Pushing two stops close together creates a sharp transition, which is how you build stripes and split backgrounds.
What angle should I use for a linear gradient?
In CSS, 0deg points up and 90deg points right, so 135deg (the default here) runs from top left to bottom right. That diagonal reads naturally because it matches how light tends to fall in interfaces. Drag the slider anywhere from 0 to 360 and watch the preview to judge it.
Can this work as a radial gradient css generator?
Yes. Open the Radial tab and the output becomes radial-gradient(circle, ...) with your stops intact. Stop positions then describe distance from the center outward instead of distance along a line, so 0% sits in the middle and 100% at the edge.
Does the conic gradient type use the angle slider too?
It does. For conic output the slider sets the starting rotation, written as conic-gradient(from 135deg, ...). Colors then sweep around the center point, which is what you want for pie charts, color wheels, and spinner effects.
Why does my gradient show visible banding?
Banding happens when two distant colors stretch across a large area and the display can't render enough in-between shades. Add an intermediate color stop, shorten the distance between stops, or pick hues that sit closer together. Subtle gradients band less than high-contrast ones.
Is the copied gradient code ready for production?
Yes, the tool outputs a single standards-compliant background declaration with no vendor prefixes needed. Linear and radial gradients have worked unprefixed for over a decade, and conic-gradient has been supported in every major browser since 2020.
Can I type a hex code into a gradient stop directly?
Every stop has a monospace text field next to the swatch, so you can paste exact brand colors like #6366F1 instead of hunting with the picker. The position field beside it accepts any whole number from 0 to 100.

More CSS tools

View all