CSS Gradient Generator

Create beautiful CSS gradients visually. Adjust colors, angles, and positions, then copy the generated CSS code.

Safe conversion with no data sent to server

Last updated: March 2026

#FF0000
#0000FF
background: linear-gradient(135deg, #FF0000 0%, #0000FF 100%);

What is a CSS Gradient?

A CSS gradient is a smooth transition between two or more colors, rendered entirely by the browser without needing image files. Gradients are defined using CSS functions like linear-gradient(), radial-gradient(), and conic-gradient(), and are applied to the background property.

Because gradients are generated by the browser, they are resolution-independent, scale perfectly on any screen size, and load instantly with zero additional HTTP requests. They are a cornerstone of modern web design for creating visually appealing backgrounds, buttons, overlays, and decorative elements.

Linear vs Radial vs Conic Gradients

Linear gradients transition colors along a straight line defined by an angle. A 0deg gradient goes from bottom to top, 90deg from left to right, and 180deg from top to bottom. They are the most commonly used gradient type in web design.

Radial gradients radiate outward from a center point in either a circular or elliptical shape. You control the center position and shape to create effects like spotlight highlights, glowing orbs, or soft vignettes.

Conic gradients sweep color transitions around a center point, similar to the color wheel of a pie chart. They are perfect for creating color wheels, gauges, and unique rotational patterns. The starting angle determines where the first color begins.

How to Write CSS Gradient Code

CSS gradients are written as values for the background or background-image property. The basic syntax includes the gradient function, an optional direction or angle, and a comma-separated list of color stops.

Each color stop consists of a color value (HEX, RGB, HSL, or named color) and an optional position as a percentage or length. For example: background: linear-gradient(135deg, #FF0000 0%, #0000FF 100%);

You can layer multiple gradients by separating them with commas, and combine gradients with solid colors or images for complex visual effects. Modern browsers support all three gradient types without vendor prefixes.

FAQ

How many color stops can a CSS gradient have?

CSS gradients can technically have an unlimited number of color stops. However, for performance and visual clarity, most designers use between 2 and 5 stops. This tool supports up to 5 color stops to keep things manageable and performant.

Are CSS gradients supported in all browsers?

Yes, CSS gradients (linear, radial, and conic) are supported in all modern browsers including Chrome, Firefox, Safari, and Edge. Conic gradients have the newest support but are available in all current browser versions. No vendor prefixes are needed.

Can I use gradients with transparency?

Absolutely. You can use RGBA or HSLA color values in your gradient stops to include transparency. For example, transitioning from a solid color to rgba(0, 0, 0, 0) creates a fade-to-transparent effect. This is commonly used for overlay effects on images and hero sections.