Discover
Random

CSS Gradient Generator

Build linear, radial, and conic CSS gradients visually — add color stops, preview live, copy the code.

Gradient Type
°
Preview
Color Stops
Generated CSS
Presets

CSS Gradient Generator — build any gradient and copy the code

Our free css gradient generator makes it easy to create linear, radial, and conic gradients without wrestling with CSS syntax. Pick your gradient type, add as many color stops as you need, drag them into position, and watch the live preview update instantly. When the gradient looks right, the ready-to-paste CSS background line is waiting with a single-click copy.

Each color stop supports full alpha transparency, so you can fade colors in and out or blend to a fully transparent edge. For linear gradients, choose a custom angle (0–360°) or pick a directional keyword like to right or to bottom right. Radial gradients let you set the shape (circle or ellipse) and center position. Conic gradients add a sweep angle and a center point. Start from a built-in preset or hit Random to generate something unexpected and customize from there.

Everything runs locally in your browser — no sign-up, no uploads, no limits. The generated CSS is valid and ready to drop straight into your stylesheet.

About the CSS Gradient Generator

How It Works & Methodology

The CSS Gradient Generator is a free browser-based tool that lets you create any CSS gradient visually and copy the ready-to-use code. Choose between linear, radial, and conic gradient types, add as many color stops as you need, set each stop's color and alpha, and watch the live preview update in real time. When the gradient looks right, the full background CSS line is one click away.

A CSS gradient is a smooth transition between two or more colors, defined entirely in CSS — no images required. linear-gradient() blends along a straight line, radial-gradient() spreads out from a center point, and conic-gradient() sweeps the colors in a circle like a color wheel. All three are supported here.

Features

Three gradient types

Linear, radial, and conic — each with dedicated controls for angle, shape, and position.

Unlimited color stops

Add as many stops as you need. Position each one from 0–100% and blend them freely.

Alpha transparency

Each stop has an alpha channel (0–1). Set it below 1 and the CSS output switches to rgba() automatically.

Add Midpoint

Inserts a blended stop at the midpoint of the largest gap — a quick way to add smooth color transitions.

Live preview

The gradient preview and CSS output update instantly as you change any value.

Presets and random

Start from a ready-made preset or generate a random gradient and customise from there.

Copy-ready CSS

One click copies the full background line — paste straight into your stylesheet, no editing needed.

Fully client-side

Nothing is sent to a server. All processing happens in your browser — fast, private, and works offline.

Authoritative Sources & Standards

  1. MDN Web Docs — Web APIs, Encoding & Data Formats Specification — Mozilla Developer Network (MDN)
  2. IETF RFC Standards Index (RFC 3986 URI, RFC 4648 Base64, RFC 7519 JWT, RFC 8259 JSON, RFC 9562 UUID) — Internet Engineering Task Force (IETF)

Frequently Asked Questions

How does the CSS gradient generator work?

Pick a gradient type (linear, radial, or conic), add and position your color stops, then adjust the direction or angle. A live preview updates instantly and the matching CSS background line is ready to copy.

What gradient types are supported?

Linear, radial, and conic gradients. Linear blends along a straight line at a chosen angle. Radial blends outward from a center point. Conic sweeps around a center like a color wheel.

Can I use more than two colors?

Yes — add as many color stops as you like with the Add Stop button. Each stop has its own color, alpha, and position. Use Add Midpoint to automatically insert a blended stop between the widest gap.

Can I control transparency?

Yes. Each color stop has an alpha field (0–1). Set alpha below 1 to make that stop semi-transparent, or 0 to fade to fully transparent. The generated CSS uses rgba() for stops with alpha below 1.

What CSS does it output?

It outputs the full background CSS line, such as background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); — ready to paste directly into your stylesheet.

What is the difference between linear, radial, and conic?

Linear gradients blend along a straight line in a given direction. Radial gradients spread outward from a center point in an ellipse or circle shape. Conic gradients rotate the color stops around a center point, like a color wheel or pie chart.

Are there presets?

Yes — click any swatch in the Presets row to load a ready-made gradient, or click Random to generate one with random colors and type. Customise from there.

Embed CSS Gradient Generator

Copy and paste this HTML snippet to embed this interactive calculator on your website or blog:

Discover more tools

Surprise me