QREndless

CSS Gradient Generator

Linear & radial gradients with live CSS output.

100% on-device
Gradient Type
Color Stops (3/6)
#ff5e7a
Position0%
#7c3aed
Position50%
#06b6d4
Position100%
Angle45°
0°360°
Live Preview
Generated CSS
background: linear-gradient(45deg, #ff5e7a 0%, #7c3aed 50%, #06b6d4 100%);
Free online CSS gradient generator creating linear and radial gradients with copyable CSS code

The Best CSS Gradient Generator

Three Gradient Types

Switch between Linear, Radial, and Conic gradients with one click. Adjust angle for Linear/Conic, and center position for Radial/Conic — all with smooth sliders and instant preview.

Live Preview

See your gradient render in real time as you move sliders or pick colors. Up to 6 color stops with independent 0-100% positions. Add and remove stops freely (min 2, max 6).

100% Browser-based

No server round-trip, no signup, no upload. Everything runs in your browser with the Web Crypto API for random gradients. Your colors and stops never leave the page.

Copy CSS or Tailwind

One click to copy production-ready CSS: `background: linear-gradient(...)`. Or copy as a Tailwind arbitrary value: `bg-[linear-gradient(...)]`. Plus a Random button for instant inspiration.

How to Use It in 3 Steps

  1. Pick Type + Colors

    Choose linear, radial, or conic, then add 2–6 color stops from the curated palette or random shuffle. The preview canvas updates with every change.

  2. Tune Angle + Positions

    Slide each stop’s position (0–100%) and the gradient angle (linear) to control where colors begin, blend, and end — live, down to the pixel.

  3. Copy the CSS

    One click copies the full background declaration — background-image: linear-gradient(135deg, #ff5e7a 0%, …) — ready for any stylesheet or Tailwind arbitrary value.

CSS Gradient Generator for Every Need

Heroes & Banners

The modern landing-page hero: a 135° two- or three-color wash behind headline text, plus gradient section dividers that do not need an image asset.

Buttons & CTAs

Gradient buttons still convert. Keep the angle subtle (90–135°), the hue family close, and the text contrast high — build it here, copy, ship.

Page & Card Backgrounds

Soft radial washes behind cards and sections add depth without images — and CSS gradients weigh bytes, not kilobytes.

Charts & Data-Viz

Color scales for heatmaps, progress bars, and area-chart fills: conic gradients make natural donut/gauge segments, linear ramps make instant color scales.

Social Graphics & Art

Backgrounds for quote cards, thumbnails, and posters — dial in the vibe in the browser, then recreate or export the exact CSS values.

Logos & Brand Assets

Two-stop brand gradients are easier to keep consistent when they live as CSS (or SVG) values — copy the exact declaration into your style guide.

Complete Guide

CSS Gradient Generator: The Complete A-to-Z Guide

Linear vs radial vs conic, how color stops and angles really work, keeping the middle from going muddy, and where gradients help or hurt your design.

What Is a CSS Gradient?

A CSS gradient is a programmatically generated image: the browser computes a smooth transition between two or more colors and paints it wherever an image could go — background-image, borders (via border-image), even text (with background-clip). Because it is math instead of a file, a gradient costs a few dozen bytes, renders razor-sharp on any display, and adapts when you resize. Every declaration has the same anatomy: a type and angle, then a comma-separated list of color stops, each optionally positioned — linear-gradient(135deg, #ff5e7a 0%, #7c3aed 50%, #06b6d4 100%).

Linear, Radial, and Conic: Which Type When

  • Linear — colors flow along a straight line at an angle. The default for heroes, buttons, and banners; 90° blends top-to-bottom, 135° gives the classic diagonal.
  • Radial — colors radiate from a center point in a circle or ellipse. Perfect for spotlights, glows, vignettes, and soft washes behind cards.
  • Conic — colors sweep around a center like a clock hand, from a start angle to a full turn. The native choice for pie charts, donuts, gauges, and color wheels; with hard stop positions it draws crisp sectors.

Color Stops: How Positioning Works

Each stop has a color and a position (0–100% along the gradient line). Between stops the browser interpolates; before the first stop and after the last, colors stay solid. Move two stops closer together and the transition compresses into a hard-edged blend; put them at the same position and you get a hard line — the trick behind striped and conic-sector effects without any image. This generator gives each stop a slider so you can drag the transition points while watching the canvas, and supports 2–6 stops: two for classic fades, three for the popular tri-color washes, more when a chart scale demands it.

Angles and Directions Explained

For linear gradients the angle points where the gradient is heading, measured clockwise from “to top”: 0deg = bottom→top, 90deg = left→right, 180deg = top→bottom, 135deg = top-left→bottom-right (the favored diagonal). Keywords work too — to right, to bottom left — but degrees are what design tools export, and they behave the same everywhere. Radial and conic gradients position instead: circle at center, at 25% 75% — moving the center is how you push a glow where it matters.

Keeping the Middle from Going Muddy

Blend two complementary colors (red→green) and the midpoint math averages their RGB values into a gray sludge. Fixes, in order of preference: route through a third color (red → amber → green keeps the journey warm), stay in one hue family and vary lightness instead, or use near-neighbors from the color wheel (violet→pink→coral never muddies). The curated swatch palette in this tool is arranged so adjacent picks blend cleanly — the random shuffle is biased toward harmonies for the same reason.

Gradients and Accessibility

Two checks keep gradients inclusive. Text contrast: WCAG’s 4.5:1 requirement applies at the worst spot — measure the lightest stop under your text, not the average, or dark text on a light-to-dark wash fails at one end. Decoration: gradients carry no meaning, so never use color position alone to encode information a chart user needs. One more practical note: smooth, wide gradients can band on 8-bit displays; adding a third midpoint stop or a whisper of noise dithers the transition visibly better.

Where Gradients Shine (and Where They Do Not)

Gradients excel as backgrounds for content (heroes, banners, empty states), as brand accents (buttons, icons, borders), and as data encodings (scales, gauges). They struggle as backgrounds for busy text — a high-contrast rainbow behind a paragraph guarantees poor readability — and they date quickly when oversaturated: the 2016 purple-to-teal look is instantly recognizable. The modern recipe: low saturation, close hues, subtle angle, generous dark-mode variant. If the gradient is the loudest thing on the page, it is doing too much.

Step-by-Step: Using the CSS Gradient Generator

  1. Choose the type. Linear for banners and buttons, radial for glows and washes, conic for wheels and gauges.
  2. Set your stops. Add up to 6, pick colors from the palette, or shuffle for a curated random starting point.
  3. Dial the angle. 135° is the modern default for linear; nudge ±20° to change the energy without changing the palette.
  4. Drag stop positions to control where the blend happens — pull stops together for punchier transitions.
  5. Check it against your content — text over gradient needs contrast at the lightest point.
  6. Copy the CSS and paste it into your stylesheet or design token file.

Ready to Build Your Gradient?

You know the three types, how stops and angles steer the blend, why complements turn muddy and how to route around it, and what accessibility demands. Scroll back up, pick your colors, and copy a production-ready gradient declaration in seconds.

Jump back to the CSS gradient generator above ↑

Frequently Asked Questions

Everything you need to know about css gradient generator.
Is this CSS gradient generator free?

Yes — completely free, no signup, no daily limit, no watermark. Generate as many gradients as you like on any device. The tool is 100% browser-based.

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

A linear gradient transitions colors along a straight line at a given angle (0-360°). A radial gradient radiates outward from a center point (X/Y position). A conic gradient sweeps colors around a center point starting from a given angle, like a color wheel.

How many color stops can I add?

You can add from 2 up to 6 color stops. Each stop has a color picker and a 0-100% position slider. Use the Add button to append a stop, and the Trash icon on each stop to remove it (you must keep at least 2).

How do I use the generated gradient in my project?

Click "Copy CSS" to copy a ready-to-paste declaration like `background: linear-gradient(45deg, #ff5e7a 0%, #7c3aed 100%);`. If you use Tailwind CSS, click "Copy as Tailwind" to copy the arbitrary value class `bg-[linear-gradient(45deg,...)]`.

Does the Random button use a secure random source?

Yes — the Random button uses `crypto.getRandomValues` (the Web Crypto API) to pick colors and parameters, the same CSPRNG browsers use for TLS. No Math.random() anywhere in the code path.

Ready to use the CSS Gradient Generator?

Open the tool