CSS Gradient Generator

Updated July 2026

Pick two or more colors and a direction to design a linear or radial CSS gradient. Preview it live, fine-tune each color stop, then copy the ready-to-use code straight into your stylesheet. Everything runs privately in your browser.

Pick two or more colors and a direction to design a CSS gradient, then copy the ready-to-use code — for example, background: linear-gradient(90deg, #3a5bd9, #3fd0c5);
0–360°, or pick a direction below. 0° points up, 90° points right.
Live preview

How this CSS gradient generator works

A CSS gradient is a smooth blend between two or more colors, generated by the browser as an image you can drop into any background. This tool builds the gradient function for you: choose a type, set a direction, add your color stops, and the matching CSS appears instantly while the preview box fills with the result.

A linear gradient blends colors along a straight line set by an angle — 0deg points up, 90deg points right, 180deg points down. A radial gradient radiates outward from the center, ignoring the angle. Each color stop can carry an optional position percentage that pins it to a point along the gradient, letting you control exactly where one color hands off to the next.

Worked example: a linear gradient at 90deg with two stops, #3a5bd9 at 0% and #3fd0c5 at 100%, produces background: linear-gradient(90deg, #3a5bd9 0%, #3fd0c5 100%); — a left-to-right blend from blue into teal. Switch the type to radial and it becomes background: radial-gradient(circle, #3a5bd9 0%, #3fd0c5 100%);, a blue glow fading to teal at the edges.

Reference note: gradients are image values, so they work with background and background-image on any element. Modern browsers support 2 to many color stops; this tool keeps it to a practical 2–5 for clean, copy-ready code.

Sample gradient snippets

EffectCSS
Left to right, two colorsbackground: linear-gradient(90deg, #3a5bd9 0%, #3fd0c5 100%);
Top to bottom, two colorsbackground: linear-gradient(180deg, #7d97f4 0%, #2942b8 100%);
Diagonal, three colorsbackground: linear-gradient(45deg, #3a5bd9 0%, #c98a1a 50%, #3fd0c5 100%);
Radial glowbackground: radial-gradient(circle, #3fd0c5 0%, #0c1018 100%);

Frequently asked questions

How do I create a CSS gradient?
Use linear-gradient() or radial-gradient() as the value of the background property, listing two or more comma-separated colors. For example: background: linear-gradient(90deg, #3a5bd9, #3fd0c5);
What is the difference between linear and radial gradients?
A linear gradient blends colors along a straight line at a set angle, while a radial gradient spreads colors outward from a center point. Use linear for bands of color and radial for a spotlight or glow.
How do I add more than two colors to a gradient?
Add extra comma-separated color stops, each with an optional position percentage, such as linear-gradient(90deg, #3a5bd9 0%, #c98a1a 50%, #3fd0c5 100%). This generator supports two to five stops.
How do I change the gradient direction or angle?
For a linear gradient, set the angle — 0deg points up, 90deg right, 180deg down — or pick a direction preset. Radial gradients spread from the center and have no angle.
Can I use gradients as a background?
Yes. A gradient is an image value, so apply it with background or background-image on any element. It scales to fill the element by default.
How do I copy the gradient CSS?
Build your gradient, then press Copy CSS. The full declaration is placed on your clipboard, ready to paste into your stylesheet.
⚡ CSS Gradient Generator — by larely ↗

Related tools

UUID Generator

Generate random version-4 UUIDs, one or in bulk, in your browser.

Text Diff Checker

Compare two texts and highlight the differences line by line.

CSS Box Shadow Generator

Visually design a CSS box-shadow and copy the code.

HTML Entity Encoder / Decoder

Escape and unescape HTML special characters and entities.

Text to Speech Reader

Read any text aloud with your browser's built-in voices.

Regex Tester

Test and debug regular expressions live, with match highlighting and groups.

Cron Expression Generator

Build, explain and preview cron schedules with their next run times.

Aspect Ratio Calculator

Resize dimensions proportionally and simplify resolutions to a ratio.

Markdown Preview

Live Markdown-to-HTML preview with copyable HTML output.

Subnet Calculator

IPv4 CIDR subnet calculator: network, broadcast, mask and host range.

PX to REM Converter

Convert between px, rem, em and pt for CSS at any base font size.

Hash Generator

Generate SHA-256, SHA-1, SHA-384 and SHA-512 hashes in your browser.

Browse all 251 free tools →