CSS Gradient Generator

Generate linear and radial CSS gradients — free, in your browser.

Processed locally — files never leave your device

Pick two colors, set the angle and the type. The preview and CSS update as you change them.

 
Works offline once loaded Uploaded: 0 bytes

Gradients add depth to buttons, hero sections and cards without a single image download — and they are one line of CSS. This free generator builds linear and radial gradients from any two colors, at any angle, with a live preview and a copy button for the exact CSS.

It runs entirely in your browser, so nothing is uploaded and it works offline once the page loads. Pick two colors, set the angle, and copy the background line into your stylesheet. For multi-color backgrounds, try the Mesh Gradient Generator.

How to use

  1. Pick the first color with the left color picker.
  2. Pick the second color with the right color picker.
  3. Set the angle and choose linear or radial.
  4. Press Copy CSS to paste the background line into your stylesheet.

Why use Toolsvine

A gradient is one line of CSS, but writing it by hand means remembering the angle syntax, the color-stop order and the vendor rules — and a wrong angle makes a hero section look backwards. A live preview with a copy button turns a lookup into a second, and the same two colors that make a good gradient also make a good palette, free, with no account and no upload.

What is a CSS gradient?

A CSS gradient is a smooth blend between two or more colors, drawn by the browser instead of an image file. A linear gradient runs in a straight line at an angle — 135 degrees runs from the top-left corner to the bottom-right — while a radial gradient spreads outward from a center point, like a spotlight.

Both are one line of CSS, so they load instantly and scale to any screen without a single image download.

Gradients are the standard way to add depth to buttons, hero sections and cards without images. The browser renders them at the device's full resolution, so they never blur on a retina display, and they can be layered under text, over photos, or animated with a background-position shift.

Worked example: a 135-degree gradient from #FF5733 to #33DBFF

Pick #FF5733 and #33DBFF at 135 degrees and the generator reports background: linear-gradient(135deg, #FF5733, #33DBFF). The gradient starts orange-red in the top-left corner, passes through purple in the middle — the same #800080 blend the color mixer makes from red and blue — and ends cyan in the bottom-right corner.

At 0 degrees the same two colors run left to right, and at 90 degrees they run top to bottom.

CSS gradient generator worked example: linear gradient 135 degrees from FF5733 orange to 33DBFF cyan
linear-gradient(135deg, #FF5733, #33DBFF) — orange to cyan, corner to corner.

Common angles

AngleDirectionBest for
0 degreesLeft to rightButtons, progress bars
90 degreesTop to bottomHero sections, headers
135 degreesTop-left to bottom-rightCards, banners
180 degreesRight to leftMirrored layouts
RadialCenter outwardSpotlights, glows

Angle 135 degrees is the most popular diagonal in modern design, because it reads as light falling from the top-left, the way readers scan a page. Radial gradients work best behind a single focal point, such as a headline or a product photo.

How do I use the gradient in my stylesheet?

Copy the background line and paste it into any CSS rule — a button, a hero section or a card. Add a solid background-color before it as a fallback for older browsers, and check text on top with a contrast checker, because a gradient's lightest point is where the text sits.

For a richer background with several colors, layer multiple radial gradients with the mesh generator.

To build the two colors themselves, start from a base with the Complementary Color Finder — opposites make the most energetic gradients — or the Analogous Color Generator for a smooth, calm blend.

Frequently asked questions

How do I generate a CSS gradient?

Pick two colors, set the angle and the type — the preview and the CSS code update instantly. Press Copy CSS to paste the background line into your stylesheet. Linear gradients run in a straight line at an angle, radial gradients spread outward from a center point like a spotlight.

Is my color data uploaded anywhere?

No. The generator runs in your browser with JavaScript. Nothing leaves your device, and the page works offline after it loads. Your brand colors and client palettes never leave your computer, which is the whole point of a local generator when you are working with unreleased designs.

What is a CSS gradient?

A CSS gradient is a smooth blend between two or more colors, drawn by the browser instead of an image file. A linear gradient runs in a straight line at an angle — 135 degrees runs from the top-left corner to the bottom-right — while a radial gradient spreads outward from a center point, like a spotlight. Both are one line of CSS, so they load instantly and scale to any screen.

Which angle should I use?

Angle 135 degrees is the most popular diagonal in modern design, because it reads as light falling from the top-left, the way readers scan a page. 0 degrees runs left to right and suits buttons and progress bars, while 90 degrees runs top to bottom and suits hero sections and headers. Try 135 degrees first and adjust from there.

How do I use the gradient in my stylesheet?

Copy the background line and paste it into any CSS rule — a button, a hero section or a card. Add a solid background-color before it as a fallback for older browsers, and check text on top with a contrast checker, because a gradient's lightest point is where the text sits. For a richer background with several colors, layer multiple radial gradients with the mesh generator.