CSS Gradient Generator

Free toolNo sign-up
Surface:
Aa
Linear2.43:1 · Fail
ModeLinear
Angle135°
Stops2
FormatHEX
Animationoff

About this generator

Six gradient modes in one editor — linear, radial, conic, repeating-linear, repeating-radial, and mesh. Per-stop alpha, animated keyframes with prefers-reduced-motion guard, background-aware preview compositing over 6 surface presets, drag-to-reorder stops with FLIP animation, OKLCH output, URL-hash share links. Export to CSS, SCSS, Tailwind arbitrary-value, React inline-style, or Vue scoped CSS. Free, MIT-licensed, no signup.

Tailwind CSS Gradient Generator (v3 + v4, Arbitrary Values)

Switch the export tab to Tailwind and the generator emits arbitrary-value class syntax — bg-[linear-gradient(137deg,#a78bfa_0%,#06b6d4_100%)] — that works identically on Tailwind v3 (with JIT) and v4 (alpha + stable). No migration needed when you upgrade.

Why arbitrary values instead of the built-in utilities?

Tailwind’s named gradient utilities (bg-gradient-to-r, from-, via-, to-) cover the simplest case: 2–3 stops, linear gradient, one of 8 fixed angles. The moment you need a 4-stop linear, ANY radial-gradient, a conic-gradient, an animated gradient with @keyframes, or per-stop alpha, the named utilities can’t express it. Arbitrary values are the escape hatch every shadcn/ui, Vercel, Linear, and Stripe-style production site uses for hero gradients.

Tailwind v4 specifically

If you’d rather extract the gradient to your design system in v4, copy the CSS export instead and paste it into the new @theme block in your CSS root. Reference as a custom utility from there. Both approaches survive Tailwind v3-to-v4 migration since the underlying gradient syntax is identical CSS.

Conic Gradient Generator (Pie Charts, Color Wheels, Rainbow)

Switch to Conic mode for the gradient type that radiates color stops around a centre point — the math behind CSS pie charts, color wheels, rainbow loaders, and dial-style data visualisations. No other generator in the top 10 ships conic-gradient support: CSSGradient.io, ColorZilla, and mycolor.space all stop at linear + radial. Conic gradients shipped to all evergreen browsers in 2020 (Chrome 69+, Safari 12.1+, Firefox 83+).

Three common use cases: pie / donut charts (paste stop percentages matching your data and you have a chart in CSS, no SVG required); rainbow loaders (one conic gradient with 6 rainbow stops, rotated via animation); and colour wheels (a conic gradient where every stop is the hue at that angle, used as a background for hue-picker UIs).

The “Rainbow” preset in the curated list demonstrates a 7-stop conic that’s the canonical CSS rainbow recipe. Click it, then adjust the starting angle to rotate where red begins.

CSS Mesh Gradient Generator (Multi-Radial Blob Composition)

Switch to Mesh mode and the generator composes 3–5 radial-gradient() layers stacked on a single background-image, with smartly-placed positions and soft fade radii. This is the production-grade approach to mesh gradients that Stripe, Linear, and Vercel actually ship today.

Why not a native mesh-gradient() function?

Native CSS doesn’t yet have a single mesh-gradient() function — it’s still in the CSS Color spec proposal pipeline (CSS Images Module Level 4 draft). Until that ships, the multi-radial-stack technique is the most reliable cross-browser way to produce blob-style mesh aesthetics. The output is pure CSS — no SVG, no JS, no asset requests, no canvas rendering. Drop it into a hero section and ship.

Compared to Figma’s Mesh tool and Hypercolor

Figma’s native Mesh tool produces an exported PNG (not CSS) — great for design files, useless for production code. Hypercolor is a Tailwind-specific mesh tool but only outputs static palettes from a curated library. This generator’s mesh mode is fully interactive: drag stops to reposition the radial centres, tweak alpha per stop for softer blends, choose any of the 6 background surfaces to preview against. The mesh recipe alone makes this generator usable for the entire 2026-modern marketing-site aesthetic.

Animated CSS Gradient Generator (@keyframes + prefers-reduced-motion)

Toggle Animation in the controls and the CSS export grows a working @keyframes gradientShift block, a background-size: 200% 200% declaration to give the animation room to pan, and an animation: gradientShift 8s ease infinite rule. The duration is editable inline. Paste into any element and the gradient animates immediately.

Most free gradient generators ship a STATIC gradient and stop there — you’d have to hand-write the keyframes block yourself, calculate the background-size offset, and remember to wrap the rule in an accessibility guard. This generator wires it all in one toggle, including the @media (prefers-reduced-motion: no-preference) wrapper so users with vestibular sensitivity (~35% of adults have some motion preference) see a static gradient instead of a moving one.

The animation works for every mode: linear gradients pan diagonally, radial gradients pulse from centre, conic gradients rotate around the centre. The exported CSS is production-ready — no extra dependencies, no JS animation library, no GSAP. Just pure CSS that runs on the GPU compositor.

OKLCH Gradient Generator (Perceptually-Uniform Color Interpolation)

Switch the colour format toggle to OKLCH and every stop in the export uses oklch(L% C H) notation instead of hex. OKLCH is the modern perceptually-uniform colour space — Chrome 111+, Safari 16.4+, Firefox 113+ all support it natively.

Why this matters for gradients specifically: the classic CSS gradient interpolation bug is that a gradient between #ff0000 (red) and #00ff00 (green) goes through a muddy brown in the middle instead of a clean yellow. The browser is doing the math in sRGB, which isn’t perceptually uniform. OKLCH gradients interpolate through Oklab-space, which preserves vibrancy through the entire transition. Modern browsers also support an explicit interpolation hint — linear-gradient(in oklch, #ff0000, #00ff00) — that opt-ins to perceptually-uniform interpolation while keeping the colour stops as hex.

If you need to support browsers older than Chrome 111 / Safari 16.4, stick with the HEX export. For modern product surfaces (post-2023 browsers), OKLCH is the better default and the recommended approach in the CSS Color Module Level 4 spec. This generator is one of the only free gradient tools that exposes OKLCH output — no competitor in the top 10 SERP results does.

Compared to CSSGradient.io, ColorZilla, ColorSpace, Gradienty & Hypercolor

The gradient generator space has good options — but each top result is strong in one dimension and weak in another. Here’s the honest matrix:

FeatureCSSGradient.ioColorZillaColorSpaceGradientyHypercolorCodeFronts
Linear
Radial
Conic
Repeating linear / radial
Mesh (multi-radial)✅ Tailwind only
Animated (@keyframes)✅ + a11y guard
Per-stop alphapartial✅ slider
Drag-to-reorder stops✅ FLIP
Tailwind export✅ v3 + v4
React / Vue / SCSS exportSCSS only✅ all 3
OKLCH output
Preset library135+yessmall20,000+Tailwind18 + Phase 2 expansion
URL hash share link
FAQ schema (JSON-LD)
Free, no signup

Where each competitor leads: Gradienty has the largest browse library (20,000+ gradients for inspiration) and the most polished Tailwind-specific UI; ColorZilla has 10+ years of refinement and SVG export with old-browser prefixed CSS; CSSGradient.io has the strongest blog SEO + color-swatch reference pages. Where this generator leads: mode coverage (6 modes vs their 1–3), framework export breadth (5 frameworks vs their 1–2), accessibility (animated gradient with reduced-motion guard, OKLCH for perceptual uniformity), and the editor’s customisation depth (alpha sliders, drag-reorder, background-aware preview).

?

How to use

01
Choose a gradient mode
Six modes — linear (directional), radial (circular burst), conic (pie-chart sweep), repeating-linear / repeating-radial (tiled patterns), and mesh (multi-radial blob composition). The mode picker is the top-left of the controls rail.
02
Set your color stops
Click any swatch to open the picker. The Position slider moves a stop along the track; the Alpha slider sets transparency (gets emitted as 8-digit hex / rgba / oklch with alpha based on your output format).
03
Reorder via drag handle
Grab the ⋮⋮ handle on any stop and drag to reorder. Colors carry along the gradient track — you see the gradient redraw as the drop indicator moves between rows.
04
Add stops or distribute
"+ Add stop" inserts a new midway color; "⇔ Even space" auto-distributes existing stops evenly along the track — useful when you've added 4-5 colors and want them perfectly spaced.
05
Adjust angle / radial
Linear and conic modes show an Angle slider (0-360°). Radial modes show shape (ellipse / circle) and origin (center, corners, edges). Mesh ignores both — its layout is composed automatically.
06
Toggle animation
Flip Animate gradient and the export grows a working @keyframes block + background-size: 200% 200% + animation declaration, wrapped in a prefers-reduced-motion guard. Duration is editable from 1-30 seconds.
07
Pick a surface to preview
The preview canvas can be set to White, Dark, Black, Brand purple, or a photo-mesh surface so you can see how your gradient — especially one with alpha — composites over the real surface it will ship on.
08
Pick a format & export
Tabs across the export pane: CSS, SCSS (with extracted variables), Tailwind (arbitrary-value classes), React (inline-style object), Vue (scoped CSS). One click to copy.
A

Syntax parameters

ParameterApplies toDescription
anglelinear, conicDirection of the gradient — e.g. 135deg, to right, to bottom left. The Angle slider (0-360°) controls this.
shaperadialellipse (default) or circle. Picked via the Shape toggle in the Radial options section.
positionradialCenter point — e.g. at center, at top right. Picked via the Origin dropdown (9 named positions).
color stopallA color followed by an optional position — e.g. #7c3aed 0%, #06b6d4 100%. The generator emits the format you pick in the Output color space section: hex (with rrggbbaa for alpha), rgb/rgba, hsl/hsla, or oklch (modern).
alphaallEach stop has its own Alpha slider (0-100%) — independent of the hex color. Output uses 8-digit hex (#rrggbbaa) by default, or rgba/hsla/oklch with explicit alpha when the corresponding format is picked. Unlocks glass overlays, fade-to-transparent, tints over photography.
animationallToggle "Animate gradient" to ship the export with a working @keyframes gradientShift block + background-size: 200% 200% + animation declaration, wrapped in a prefers-reduced-motion guard. Duration is editable from 1-30s.
repeating-*linear, radialPick "Rep. Linear" or "Rep. Radial" in the Mode row to tile the gradient outward. The stops' final position % defines one band of the repeat — set it low (e.g. 20%) for tight stripes, high (e.g. 80%) for wide bands.
mesh (CSS hack)meshCSS doesn't (yet) ship a native mesh-gradient() function — the Mesh mode composes 3-5 radial-gradient layers stacked on a single background-image, at distributed positions. The output is pure CSS, no SVG.
</>

CSS syntax examples

Linear
background: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
Radial
background: radial-gradient(ellipse at center, #7c3aed 0%, #0a0a0a 70%);
Conic
background: conic-gradient(from 90deg, #7c3aed, #ff6c8a, #06b6d4, #7c3aed);
Multi-stop
background: linear-gradient(
  135deg,
  #7c3aed 0%,
  #a855f7 40%,
  #06b6d4 100%
);

Pro tips

01
Gradient text via background-clip
Apply a gradient to text by setting it on the element's background, then `-webkit-background-clip: text` + `color: transparent`. Three-line headline hero treatment, no SVG required. See our dedicated <a href="/collections/css-gradient-text/">CSS Gradient Text</a> collection for tested patterns.
02
Animate via the built-in toggle
Flip Animate gradient in the controls — the export grows a working @keyframes block with `background-size: 200% 200%` + a `prefers-reduced-motion` guard, ready to paste. No more hand-writing keyframes blocks every time you want a moving background.
03
Fix the "gray zone" with OKLCH
Gradients between complementary colors (red ↔ green, blue ↔ orange) pass through muddy gray in sRGB. Switch the Output color space to OKLCH and the same two stops interpolate through vibrant intermediates instead — perceptually-uniform color space, designed for this exact problem. Chrome 111+, Safari 16.4+, Firefox 113+.
04
Use transparent for cross-browser fades
Browsers interpolate `rgba(0,0,0,0)` differently from `transparent` in some legacy versions. Prefer `transparent` for the fully-clear stop; use `rgba(yourColor, 0)` (with the SAME color as the other stop) if you need to fade INTO a specific tone without grayish interpolation. The generator's Alpha slider produces clean fades automatically.
05
Re-theme via a single CSS custom property
Lift the color stops into `--grad-from` and `--grad-to` on `:root`. Dark mode, brand recolors, and seasonal swaps become a one-line override instead of editing 12 different background rules. The SCSS export does this for you — each stop becomes a `$gradient-stop-N` variable.
06
Mesh for hero / marketing backgrounds
The Mesh mode composes 3-5 radial-gradient layers — exactly the technique Stripe, Linear, and Vercel use for their hero backgrounds. Pure CSS, no SVG, no image assets, no DPI banding. Pair with a subtle `filter: blur(40px)` if you want the softer Figma-style mesh look.

Gradient types

linear-gradient()
Transitions colors along a straight line at any angle.
background: linear-gradient(135deg, #7c3aed, #06b6d4);
radial-gradient()
Radiates colors outward from a center point.
background: radial-gradient(circle at center, #7c3aed, #0a0a0a);
conic-gradient()
Sweeps colors around a center like a color wheel.
background: conic-gradient(from 0deg, #7c3aed, #06b6d4, #7c3aed);
repeating-linear-gradient()
Tiles a linear gradient outward — produces stripes, barber-pole patterns, hatching.
background: repeating-linear-gradient(45deg, #0f172a 0 10px, #1e40af 10px 20px);
repeating-radial-gradient()
Tiles a radial gradient outward — produces bullseyes, target rings, sonar patterns.
background: repeating-radial-gradient(circle at center, #a78bfa 0 5px, #0f172a 5px 10px);
mesh (multi-radial)
CSS doesn't (yet) ship a mesh-gradient() function — the Mesh mode composes 3-5 radial-gradient layers to produce the blob-style aesthetic Figma and Stripe popularized.
background:
  radial-gradient(at 20% 25%, #a78bfa 0%, transparent 50%),
  radial-gradient(at 80% 70%, #ec4899 0%, transparent 50%),
  #0f0f13;

Browser support

linear-gradient() and radial-gradient() are supported in all modern browsers.conic-gradient() requires slightly newer versions — check the table below.

Browserlinear-gradientradial-gradientconic-gradient
Chromev26+v26+v69+
Firefoxv16+v16+v83+
Safariv7+v7+v12.1+
Edgev12+v12+v79+
?

Frequently asked questions

01

What makes this gradient generator different from the dozens of other free ones online?

Three things. First, the mode coverage — six gradient TYPES in one editor: linear, radial, conic, repeating-linear, repeating-radial, and CSS mesh gradient (the modern blob-style multi-radial composition). Most generators ship two or three. Second, the export breadth — five framework formats (CSS, SCSS variables, Tailwind arbitrary-value classes, React inline-style, Vue scoped CSS), not just a blob of CSS. Third, the editor power — drag-to-reorder color stops with smooth FLIP animation, per-stop alpha channel for transparent gradients, animation toggle that ships a working @keyframes block, and background-aware preview so you can see how the gradient composites over white, dark, brand, or photographic backgrounds. Older generators like CSSGradient.io or ColorZilla's tool are stuck on linear+radial and a static preview; this one matches what designers actually need in 2026.

02

Can I use this for mesh gradients? Real mesh gradients, not just radials labeled 'mesh'?

Yes — the Mesh mode composes 3-5 radial-gradient layers stacked on a single background-image, with smartly-placed positions and soft blur radii to produce the blob-style aesthetic that Figma's Mesh tool and dribbble-tier marketing sites use. Native CSS doesn't (yet) have a single mesh-gradient() function — it's still in the CSS color spec proposal pipeline — so we render mesh gradients via the layered-radials technique, which is the production-grade approach top design teams (Stripe, Linear, Vercel) actually ship today. The output is pure CSS, no SVG, no JS, no asset requests.

03

Why does it bother with per-stop alpha when I can just put rgba() in the hex field?

Because hex-with-alpha (#rrggbbaa) is a 2018+ feature that's now universally supported, AND because the dedicated alpha slider gives you a continuous knob instead of typing two hex digits and praying you picked the right number. Glass overlays, frosted backgrounds, fade-to-transparent hero shots, photo color washes — all of these need the gradient's color stops to be partially transparent so the background underneath shows through. The alpha slider produces #rrggbbaa output by default (8-digit hex), which is the most compact and most-supported syntax; the SCSS export emits rgba() with named variables instead so designers can tune transparency from a single source of truth.

04

How does the Tailwind gradient export work? Tailwind has its own bg-gradient-to-r utility — why arbitrary values?

Tailwind's built-in gradient utilities (bg-gradient-to-r, from-, via-, to-) cover the simplest case — a 2-3 stop linear gradient at one of 8 fixed angles. The moment you need a 4-stop gradient at 137°, a radial, a conic, or anything with custom alpha, the built-in utilities can't express it. The Tailwind export emits arbitrary-value syntax — bg-[linear-gradient(137deg,#a78bfa_0%,#06b6d4_100%)] — which works on Tailwind v3 and v4 identically and gives you 100% expressive power without leaving the utility-class paradigm. For users who DO want the named-utility version, the CSS export gives you the raw background: declaration you can paste into a Tailwind @layer components block.

05

What about animated gradients — does the export actually include working @keyframes?

Yes. Flip the Animation toggle and the CSS export grows a @keyframes gradientShift block, a background-size: 200% 200% setting on the element, and an animation: gradientShift 8s ease infinite declaration. The duration is editable inline. The exported CSS is production-ready — paste it into any element and the gradient will animate. For accessibility, the export also wraps the animation rule in a @media (prefers-reduced-motion: no-preference) guard, so users with vestibular sensitivity see a static gradient instead of a moving one. This is one feature most free generators skip entirely; you'd have to copy a static gradient, then hand-write the keyframes block yourself.

06

Can I save my gradient and come back to it later, or is everything lost when I refresh?

Every adjustment is encoded into the URL hash automatically — type, angle, mode, every color stop, every alpha value, animation state, background choice, and export format. Bookmark a tuned gradient, the URL preserves the entire state. Send the URL to a colleague, they see your exact configuration. No accounts, no servers, no logins. Old shared links from the May 2026 v1 of this generator still work — the hash format is strictly backward-compatible, with new fields defaulting sensibly when absent.

07

Why include OKLCH and modern color formats? Won't that break older browsers?

OKLCH (oklch() color function) shipped in all evergreen browsers — Chrome 111, Safari 16.4, Firefox 113 — and is now the recommended color format for designers because it interpolates perceptually-uniform colors. The OLD problem with gradients was: take #ff0000 (red) and #00ff00 (green), put them in a linear-gradient, and the middle is a muddy brown instead of clean yellow. OKLCH interpolation fixes this — gradients between two OKLCH colors stay vibrant through the entire transition. The export tab includes an OKLCH-format toggle; if you're shipping to a public site and need IE11 / Safari 15 support, stick with the default hex export. For modern product surfaces (post-2023 browsers only), OKLCH is the better default and the spec body's recommended approach.

08

How is this different from CSSGradient.io, ColorZilla, ColorSpace, or Gradienty?

Each top competitor in this space is strong in one dimension and weak in another. CSSGradient.io has the strongest preset library + blog SEO but only ships linear and radial modes (no conic, repeating, mesh, or animated). ColorZilla has the longest history (10+ years) and the Photoshop-style multi-stop editor, but the UI shows its age and there's no Tailwind / React / Vue export — only CSS and SCSS via the Compass mixin format. ColorSpace (mycolor.space) is genuinely minimal — two colours + one orientation, output linear only. Gradienty has a 20,000-gradient browse library plus dedicated Tailwind workflows but doesn't expose per-stop alpha and lacks OKLCH output. This generator combines the breadth (6 modes including conic + repeating + mesh, 5 framework exports, animated keyframes with prefers-reduced-motion guards, per-stop alpha, OKLCH output) with editor power (drag-to-reorder stops with FLIP animation, background-aware preview compositing over 6 surface presets, URL-hash share links). The single feature we DON'T match: Gradienty's 20K-gradient browse library — they win on discovery; we win on customisation depth.

09

How do I generate a Tailwind v4 gradient (or v3) — and why arbitrary values?

Switch the export tab to Tailwind and the generator emits the arbitrary-value syntax: bg-[linear-gradient(137deg,#a78bfa_0%,#06b6d4_100%)]. This shape works on Tailwind v3 (3.x with JIT) and Tailwind v4 (alpha + 4.0) identically — no migration needed. Tailwind's built-in gradient utilities (bg-gradient-to-r, from-, via-, to-) cover only the simplest case — a 2–3 stop linear gradient at one of 8 fixed angles. The moment you need a 4-stop gradient at 137°, a radial-gradient, a conic-gradient, an animated gradient with @keyframes, or anything with custom alpha, the named utilities can't express it. The arbitrary-value escape hatch is what every shadcn/ui, Vercel, Linear, and Stripe-style production site actually uses for hero-section gradients. If you'd rather extract the gradient to your design system, copy the CSS export instead and add it to your @layer components block in v3 or your @theme block in v4.

10

How do I add noise / grain to a CSS gradient for that Vercel / Linear / Apple aesthetic?

The modern grainy-gradient look used by Vercel, Linear, Apple Music, and dribbble-tier marketing sites combines a smooth gradient with a fine-grain SVG noise overlay on top. The technique: generate your gradient via this tool (any of the 6 modes), then layer an inline SVG noise filter on top via a second background-image. The SVG uses feTurbulence + feColorMatrix to produce monochrome grain. Combine both with background-blend-mode: overlay (or soft-light for subtler grain) and the gradient picks up the texture without losing colour fidelity. Phase 2 of this generator will ship a Grain toggle directly in the editor — for now, copy the gradient CSS from the export tab and paste the SVG noise filter from any of the design-systems guides (search 'css grain noise SVG filter') as a second layer. The grain alone is what separates a 2026-modern hero from a 2018-flat one.

11

Is this free for commercial use? Any watermark, attribution, or license restriction?

Free, MIT-licensed, zero attribution required, no watermark, no signup, no upgrade tier hiding features. Use the generator on a paid project, a client deliverable, a startup landing page, an enterprise design system — none of those need permission. The generator itself is hosted free at codefronts.com; the output CSS is yours. If you find this useful, sharing the page on Twitter or pointing teammates at it is the best thanks; but nothing is required. (If you do post about it, the X / Facebook / LinkedIn share buttons in the header pre-fill a tweet/post for you.)

See it used in real designs

Browse hand-coded collections that put this tool to work.

Search CodeFronts

Loading…