---
title: "CSS Gradient Generator — Linear & Radial | fbuff"
description: "Build linear and radial CSS gradients visually: add and drag color stops, set the angle, preview live and copy the CSS code. Free and runs in your browser."
url: https://fbuff.com/tools/css-gradient-builder/
---

![Color gradient bar from dark to light blue with two color stop handles](https://fbuff.com/content/css-gradient-builder.webp)

## How to use

1. Choose LINEAR or RADIAL. For a linear gradient, set the angle.
2. Edit the color stops: pick each color and its position (0–100%), use ADD STOP for more colors, and drag stops in the list to reorder them. The preview updates as you go.
3. Click Copy CSS and paste the line into your stylesheet.

## CSS gradients in one line

A CSS gradient is an image the browser draws from a few colors, so it needs no file, stays sharp at any size and loads instantly. This builder writes the line for you, for example: background: linear-gradient(90deg, #3b82f6 0%, #9333ea 100%);

Linear and radial gradients without vendor prefixes work in every current browser, so the copied CSS can be used as is.

## Angles and stops

In a linear gradient the angle sets the direction the colors flow toward:

| Angle | Direction |
| --- | --- |
| 0deg | Bottom to top |
| 90deg | Left to right |
| 180deg | Top to bottom (the default) |
| 135deg | Top left to bottom right, a popular diagonal |

## Ready-made gradients to start from

Paste one of these into the builder's stops, or straight into your CSS, and adjust from there:

| Style | CSS | Good for |
| --- | --- | --- |
| Sunset | linear-gradient(135deg, #f97316 0%, #ec4899 100%) | Hero banners, call-to-action buttons |
| Ocean | linear-gradient(180deg, #0ea5e9 0%, #1e3a8a 100%) | Headers and app backgrounds |
| Mint | linear-gradient(90deg, #a7f3d0 0%, #14b8a6 100%) | Soft cards, health and finance sites |
| Spotlight | radial-gradient(circle, #ffffff 0%, #e5e7eb 60%, #9ca3af 100%) | Product photos on a plain backdrop |
| Hard stripe | linear-gradient(90deg, #111827 50%, #f59e0b 50%) | Split backgrounds with a sharp edge |

## Tips for good-looking gradients

Two or three colors close on the color wheel, such as blue to purple or orange to pink, look smooth; complementary colors such as red and green can turn muddy in the middle. Placing two stops at the same position makes a hard edge instead of a blend, useful for stripes. A radial gradient from a light center to a darker edge adds depth to a hero section or a button.

Keep text readable: put text over the darker part, or add a semi-transparent overlay, and check the pair with the Contrast Checker.

## Frequently asked questions

### Should I use background or background-image?

Either works. background-image keeps any background color you set as a fallback; the background shorthand replaces it.

### Does it make conic or repeating gradients?

No. It builds linear and radial gradients, which cover most backgrounds and buttons.

### Can I use the CSS in Tailwind or React?

Yes. Paste it into an inline style, a CSS module, or a Tailwind arbitrary value such as bg-[linear-gradient(90deg,#3b82f6,#9333ea)].

### Is anything uploaded?

No. The CSS is generated in your browser.

Found a problem or have an idea? [Report a problem](https://fbuff.com/contact/?tool=css-gradient-builder)

Share

## You might also like

- - [Color Picker Pick any color and copy HEX, RGB, and HSL values instantly.](https://fbuff.com/tools/color-picker/)
- - [Contrast Checker Check WCAG AA/AAA color contrast ratios instantly.](https://fbuff.com/tools/contrast-checker/)
- - [Color Palette Generator Generate harmonious color palettes from a base color — complementary, triadic, analogous, split-complementary. Copy HEX codes instantly.](https://fbuff.com/tools/color-palette-generator/)
- - [JSON Path Finder Inspect JSON, copy exact JSONPath expressions, and test paths locally.](https://fbuff.com/tools/json-path-finder/)
- - [URL Encoder Decoder Encode and decode URL components locally in your browser.](https://fbuff.com/tools/url-encoder-decoder/)
- - [Base64 Encoder Decoder Encode and decode Base64 text locally in your browser.](https://fbuff.com/tools/base64-encoder-decoder/)
- - [GUID / UUID Generator Generate UUIDs and convert GUIDs to short GUIDs locally in your browser.](https://fbuff.com/tools/guid-uuid-generator/)
- - [Unix Timestamp Converter Convert Unix epoch to datetime and back. 100% client-side.](https://fbuff.com/tools/unix-timestamp/)
- - [JSON Formatter Format, prettify and validate JSON instantly. Minify in one click.](https://fbuff.com/tools/json-formatter/)
- - [Cron Job Parser Parse full crontab lines with commands, explain the schedule, and preview the next 5 runs.](https://fbuff.com/tools/cron-parser/)
