CSS Gradient Generator: Linear, Radial, Mesh & Tailwind
Build linear, radial, conic or mesh CSS gradients with a live preview and copy the code as CSS or Tailwind. oklch mode, 10 presets and PNG export.
Updated November 2026
Reviewed by Rafael Duarte
⚙ Configuration
Gradient Type
Angle
Color Interpolation
background: linear-gradient(135deg, #197FE6 0%, #0EA5E9 100%);
Organize seus animes,
séries e filmes
em um só lugar.
Chega de três apps diferentes. Media tracker 100% em português, com alertas automáticos, feed social e salas de discussão.
+2.400 já na fila de espera
How to use the CSS gradient generator
Four gradient types, optional perceptual interpolation
1. Pick a gradient type
Linear, radial, conic or mesh, or start from one of the 10 presets. The live preview updates as you go.
2. Edit the color stops
In Color Stops, drag the handles along the bar, change each stop's color and opacity, and click Add for more. For linear and conic gradients, type the angle in degrees, click a point on the angle wheel or use the 0°, 45°, 90°, 135°, 180° and 270° shortcuts.
3. Copy the snippet
Use the arrows in Generated Snippet to switch formats. Linear gradients offer background, background-image, oklch, Tailwind v3 and Tailwind v4; radial and conic offer only the first two; mesh comes out as a single CSS block. Shift+Enter also copies when focus isn't in a field.
What this CSS gradient generator does
All four gradient types, including a synthesized mesh gradient
oklch interpolation mode
Perceptually uniform color blending — removes the gray "dead zone" that appears between complementary hues in plain sRGB gradients.
Mesh gradient generator
Built from stacked radial-gradient() layers over a base background-color for the "aurora" look. Each stop becomes one layer at one of 6 fixed positions, and the mesh doesn't use the oklch mode.
10 built-in presets
Start from Ocean, Sunset, Aurora, Rainbow and six more instead of picking stops from scratch.
Tailwind v3 and v4 export
Ready-to-paste classes for linear gradients. Tailwind v4 keeps every stop at any angle; Tailwind v3 uses up to 3 stops and only maps multiples of 45° to its direction classes.
Saved presets and PNG export
Save Preset keeps up to 20 combinations in your browser under My Presets, and Export PNG downloads the current gradient as an 800×600 image.
The four CSS gradient types
When to reach for each one
When you'll reach for this tool
The scenarios that come up most often
Hero section backgrounds
Mesh or linear gradients add depth in a few lines of CSS, with no background image to download.
Button hover states
A subtle linear gradient adds visual richness while a solid background-color still works as a fallback.
Glassmorphism overlays
Radial gradients with opacity stops give glassmorphism panels their translucent base — pair them with backdrop-filter: blur() for the frosted-glass look.
Gradient text
Copy the background line for a linear gradient, then add -webkit-background-clip: text, background-clip: text and color: transparent to the heading so the gradient shows through the letters.
Common CSS gradient mistakes
Muddy gradient between complementary colors
Plain sRGB interpolation creates a grayish "dead zone" between colors like blue and yellow — switch to oklch mode to avoid it.
Expecting a native mesh-gradient() function
There's no such CSS function — mesh gradients are synthesized by layering multiple radial-gradient() calls.
Forgetting -webkit-background-clip for gradient text
Write both -webkit-background-clip: text and background-clip: text, and set color: transparent. If the text keeps its color, it paints over the gradient and the effect never shows.
Why use this CSS gradient generator
It supports perceptual color interpolation via oklch for linear, radial and conic gradients, and linear gradients export straight to Tailwind v3 and v4 syntax, with the snippet ready to copy.
The mesh mode builds the "aurora" look popular in SaaS design without stacking radial-gradient() layers by hand: up to 6 stops each get their own position, over a base color taken from the last stop.
sRGB vs. oklch
Why the color interpolation space matters
Frequently asked questions
It's a tool that builds ready-to-paste CSS gradient code — you pick colors, a gradient type and a few options, and it outputs valid CSS you can drop straight into a stylesheet.
linear-gradient transitions along a straight line at a set angle, so it's always directional. radial-gradient expands outward from a focal point in a circular or elliptical shape instead.
conic-gradient() transitions colors by rotating around a center point, similar to a pie chart. It is defined in CSS Images Module Level 4, and MDN lists it as available across browsers since November 2020.
oklch is a perceptually uniform color space. Standard sRGB gradients between complementary hues pass through a grayish dead zone; oklch keeps lightness and chroma consistent across the transition, so the gradient stays vivid end to end.
Yes, for linear gradients. The Tailwind v4 format uses an arbitrary value (bg-[linear-gradient(...)]) that keeps any angle, every stop and the oklch mode. The Tailwind v3 format uses direction utilities like bg-gradient-to-br, which only exist for multiples of 45°, plus from-, via- and to- stops, and it keeps at most 3 stops (first, middle and last). For other angles or more stops, use the v4 snippet.
CSS has no mesh function, so you stack several radial-gradient() layers, each one a color fading to transparent from a different position, over a solid background-color. That is exactly what the CSS Mesh snippet gives you: pick the mesh type, set the colors and copy both declarations.
References
Related Tools
- Color Contrast Checker: WCAG AA/AAA & Color Blindness Design Check if text and background pass WCAG 2.2 AA and AAA, get the nearest passing text color and preview 4 types of color blindness. Free, in your browser.
- HEX to RGB Converter with HSL & CMYK Values Design Paste a HEX code and copy its RGB, HSL and CMYK values instantly, with 4 harmony colors, a contrast check against white and CSS palette export.
- Color Scheme Generator: Complementary, Triadic & Analogous Design Pick a base color and get 5 harmonious colors: analogous, monochromatic, complementary, triadic or tetradic. Preview them on a site, export CSS or JSON.
- Color Palette from Image: Extract HEX, RGB & HSL Codes Design Upload a photo or logo and extract 3 to 12 dominant colors as HEX, RGB and HSL. Export CSS variables, Tailwind, JSON or PNG. Nothing leaves your browser.
- CSS Box Shadow Generator: Tailwind, Neumorphism & Glass Design Create CSS box shadows with a live preview and ready-made presets, or switch to neumorphism and glassmorphism. Copy as CSS, a Tailwind class or a variable.