How to Use the CSS Gradient Generator
- Choose Linear, Radial or Conic.
- For linear and conic gradients, drag the Angle slider to set the direction or starting point.
- Pick each color with its color swatch, or type a HEX code next to it. Click + Add Color to add more colors (up to ten), and the × button to remove one.
- To control exactly where each color sits, tick Set color stop positions manually and enter a percentage for each color.
- When the preview looks right, click Copy CSS and paste the code into your stylesheet.

Linear, Radial and Conic Gradients
A linear gradient blends colors along a straight line. The angle sets the direction: 0° runs from bottom to top, 90° from left to right, 180° from top to bottom and 270° from right to left.
A radial gradient spreads colors outward from the center in a circle. The first color is in the middle and the last color is at the edge. It works well for spotlights, glows and soft vignettes.
A conic gradient sweeps colors around a center point, like the hands of a clock. The angle sets where the sweep starts. Conic gradients are useful for pie charts, color wheels and loading rings. Repeat the first color at the end for a seamless loop.
What Are Color Stops?
Each color in a gradient is a color stop. By default the stops are spread evenly, so with three colors they sit at 0%, 50% and 100%, and the generated CSS leaves the positions out because browsers place them evenly anyway. When you set positions manually, the code lists them, for example #9C6E13 0%, #E8B23D 70%, #FFFFFF 100%, and the stops are sorted in order of position. Two colors at the same position create a hard edge instead of a smooth blend, which you can use for stripes and flags.
Using the CSS
The copied code has two lines:
background: #9C6E13;
background: linear-gradient(90deg, #9C6E13, #E8B23D);
The first line is a solid fallback color for very old browsers or email clients that do not understand gradients; modern browsers use the second line. Paste both into any CSS rule, such as a page background, a button, a card or a hero banner. Gradients are drawn by the browser, so they stay perfectly sharp at any screen size and add no image file to download.
Tips for Better Gradients
- Start with similar colors. Neighboring hues, or two shades of one hue, give the smoothest and most professional results. The Color Picker & Palette can suggest analogous colors and shades.
- Avoid muddy middles. Blending two opposite colors, such as blue and orange, often passes through grey. Add a brighter color in between to keep the blend lively.
- Keep text readable. If you place text on a gradient, check contrast against both the lightest and the darkest part.
- Use transparency for overlays. To fade a photo, you can edit the copied code to use colors with transparency, such as
rgba(0, 0, 0, 0.6).
Browser Support
Linear and radial gradients work in every browser released in the last decade. Conic gradients are supported by all current versions of Chrome, Edge, Firefox and Safari. The preview on this page is drawn by your own browser, so what you see is how your visitors with modern browsers will see it.
Runs in Your Browser
Everything happens on your device, with no account required and nothing sent to a server.
Frequently asked questions
What is a CSS gradient?
It is a background made of a smooth blend between two or more colors, defined in CSS code instead of an image file.
What is the difference between linear, radial and conic gradients?
Linear gradients blend along a straight line in a chosen direction. Radial gradients spread outward from a center point. Conic gradients sweep around a center point like a clock hand.
How many colors can I use?
Between two and ten. Use the Add Color button to add more color stops and the × button to remove them.
How do I set where each color starts?
Tick Set color stop positions manually and enter a percentage from 0 to 100 for each color. The CSS then includes the positions.
Why does the CSS have two background lines?
The first line is a solid fallback color for very old browsers. Modern browsers ignore it and use the gradient on the second line.
How do I use the CSS I copy?
Paste it inside any CSS rule, for example on body, a button or a card. It sets that element's background to the gradient.
Is the gradient generator free?
Yes. It is free, unlimited and needs no account.