CSS Gradient Generator

Create beautiful CSS gradients visually. Adjust colors, stops, angle, and type — all with a live preview and ready-to-use CSS code.

135°
0%
100%

Key Features

palette

Multiple Types

Linear, radial, and conic gradients with full control over direction, shape, and position.

colorize

Multi-Color Stops

Add unlimited color stops with precise position control for complex gradients.

bolt

Live Preview

See your gradient change in real-time as you adjust colors, angles, and stops.

lock

Ready CSS

Copy the generated CSS code with one click. Compatible with all modern browsers.

What Is a CSS Gradient?

A CSS gradient is a visual transition between two or more colors, rendered directly by the browser as a background image. Unlike bitmap images, gradients are resolution-independent, scale infinitely without quality loss, and incur zero network latency since no external file is downloaded. CSS gradients are defined using the <gradient> data type and can be used anywhere an image is accepted — in background, background-image, border-image, list-style-image, and mask-image.

The Four Gradient Types

CSS defines four gradient functions, each creating a distinct transition pattern:

Linear Gradients

Colors transition along a straight line. You control the direction with an angle (e.g., 45deg) or keywords (e.g., to bottom right).

/* Top-to-bottom gradient (default) */
background: linear-gradient(#667eea, #764ba2);

/* Diagonal — 45 degrees */
background: linear-gradient(45deg, #f093fb, #f5576c);

/* With explicit color stops at specific positions */
background: linear-gradient(90deg, #ff0000 0%, #ff8800 50%, #ffff00 100%);

Radial Gradients

Colors radiate outward from a central point in a circular or elliptical shape. You define the shape, size, and center position.

/* Default circle at center */
background: radial-gradient(circle, #ff7e5f, #feb47b);

/* Elliptical gradient with position */
background: radial-gradient(ellipse at top left, #43e97b, #38f9d7);

/* Controlling size with closest-side / farthest-corner */
background: radial-gradient(circle closest-corner at 30% 50%, #fa709a, #fee140);

Conic Gradients

Colors transition around a center point in a circular sweep, like a color wheel or pie chart. The starting angle is defined by from and the center position by at.

/* Full 360-degree sweep */
background: conic-gradient(#e66465, #9198e5, #e66465);

/* Starting from 90 degrees, centered at 30% 70% */
background: conic-gradient(from 90deg at 30% 70%, red, yellow, lime, aqua, blue, magenta, red);

/* Hard color stops for a pie-chart effect */
background: conic-gradient(red 0deg 90deg, blue 90deg 180deg, green 180deg 270deg, yellow 270deg 360deg);

Repeating Gradients

All three gradient types have repeating variants that tile the color pattern infinitely. Use repeating gradients for stripes, checkered patterns, and radar-like effects.

/* Repeating linear — stripes */
background: repeating-linear-gradient(45deg, #3b82f6 0px 10px, #60a5fa 10px 20px);

/* Repeating radial — bullseye rings */
background: repeating-radial-gradient(circle, #6366f1 0px 15px, #a5b4fc 15px 30px);

/* Repeating conic — color wheel */
background: repeating-conic-gradient(#f59e0b 0deg 30deg, #fbbf24 30deg 60deg);

Color-Stop Precise Control

Each color in a gradient is defined by a color stop — a color value paired with an optional position. Positions can be specified as percentages, lengths, or both for hard color transitions. When two stops share the same position, a hard edge is created with no blending between them. This is how you create striped or banded patterns within a single gradient declaration. You can define as many color stops as needed, though practical gradients rarely need more than five or six stops.

Gradient vs Image: File Size Comparison

Using CSS gradients instead of bitmap images provides significant performance benefits. A typical gradient image file (PNG, JPG, WebP) ranges from 2 KB to 50 KB depending on dimensions and quality settings. A CSS gradient, by contrast, adds roughly 100 to 500 bytes to your stylesheet — a saving of 10 to 100 times. For pages with multiple gradient backgrounds, this difference compounds dramatically. Additionally, gradients eliminate the HTTP request overhead for each gradient image and avoid the visual artifacts of JPEG compression.

Step-by-Step Guide

  1. Choose the gradient type — Select linear, radial, or conic based on the visual direction you need.
  2. Pick your colors — Select two or more colors that harmonize. Use a color palette generator if needed.
  3. Set the direction — For linear gradients, choose an angle. For radial, choose a shape and center position. For conic, set the starting angle.
  4. Adjust color stops — Drag the stop position sliders to control where each color begins and ends its transition.
  5. Preview and tweak — Check the live preview at different screen sizes. Gradients can appear differently on wide vs narrow displays.
  6. Copy the CSS — Click the Copy button to copy the generated CSS and paste it into your project's stylesheet.

Common Use Cases

Best Practices

Related Resources

Frequently Asked Questions

Getting Started
What is a CSS gradient generator?expand_more
A CSS gradient generator is a visual tool that lets you create CSS gradient code without writing it manually. You pick colors, adjust angles, and add color stops visually — the tool generates the CSS code for you.
Is this tool free?expand_more
Yes. All tools are completely free and run locally in your browser. No signup, no limits, no hidden costs.
Gradient Types
What is the difference between linear, radial, and conic gradients?expand_more
Linear gradients transition colors along a straight line (defined by angle). Radial gradients transition outward from a center point in a circular or elliptical shape. Conic gradients transition colors around a center point in a circular sweep, like a color wheel.
Can I use these gradients in production?expand_more
Yes. CSS gradients are supported in all modern browsers including Chrome, Firefox, Safari, and Edge. The generated code uses standard CSS syntax that works across all platforms.