Create beautiful CSS gradients with a live preview. Pick colors, adjust the angle, switch between linear and radial, then copy the CSS or Tailwind classes instantly no signup, no limits, fully in your browser.
See your gradient update in real time as you adjust colors, angle, and type
Get both plain CSS and Tailwind utility classes for your gradient in one click
Start from 8 curated presets or hit Randomize for instant creative inspiration
Pick two or more colors, dial in the angle, choose linear or radial — then copy your gradient as plain CSS or Tailwind classes.
CSS
background: linear-gradient(135deg, #667eea, #764ba2);
Tailwind CSS
className="bg-gradient-to-br from-[#667eea] to-[#764ba2]"
No account required — 100% free to use
CSS gradients transform flat, solid-color interfaces into dynamic, visually engaging designs. Every modern web application from Google's search bar to Stripe's marketing page uses gradients to add depth, visual hierarchy, and brand character without adding a single image file to the page weight. This tool generates production-ready gradient code in both plain CSS and Tailwind CSS formats, so you can drop the result directly into your project.
CSS gradients are a type of CSS image that creates a smooth, programmatic transition between two or more colors entirely in code. The browser renders them natively no PNG, no SVG, no JavaScript. Because they're pure CSS, they scale perfectly to any resolution, load instantly, and respond to container size changes without any layout recalculation.
The CSS background property accepts gradient functions directly as its value. You use gradients everywhere you'd use a background image: hero sections, buttons, cards, overlays, borders (via background-clip), and even text fills.
The two gradient functions serve fundamentally different visual purposes, and choosing the wrong one is a common beginner mistake.
Colors transition along a straight line at a defined angle. The most common gradient type works for hero backgrounds, button fills, card headers, and horizontal dividers.
background: linear-gradient( 135deg, #667eea, #764ba2 );
Colors radiate outward from a central point in a circle or ellipse. Creates a spotlight or glow effect excellent for product highlights, icons, and decorative backgrounds.
background: radial-gradient( circle, #f7971e, #ffd200 );
The tool runs entirely in your browser using React state management and the CSS background property applied directly to a preview element. Here's what happens behind the scenes:
color input provides the browser's built-in color picker, while the hex field lets you type values precisely.useMemo hook recalculates the CSS string and Tailwind classes only when colors, angle, or type change preventing unnecessary re-renders on every keystroke.The CSS output block shows a ready-to-use background declaration. Paste it directly into any CSS class, inline style, or CSS-in-JS object. Here are the three most common integration patterns:
Plain CSS / SCSS
.hero-section {
background: linear-gradient(135deg, #667eea, #764ba2);
min-height: 100vh;
}React inline style
<div style={{ background: 'linear-gradient(135deg, #667eea, #764ba2)' }}>
{children}
</div>Tailwind 3 and later ships with a built-in gradient system using three utility classes: from-, via-, and to-. The direction comes from bg-gradient-{direction}. This generator maps the angle you select to the nearest Tailwind direction and outputs the correct utility string with arbitrary hex values for exact color matching:
Tailwind — 2 and 3 color examples
{/* 2-color linear gradient */}
<div className="bg-gradient-to-br from-[#667eea] to-[#764ba2]">
{/* 3-color with midpoint */}
<div className="bg-gradient-to-r from-[#a18cd1] via-[#fbc2eb] to-[#a1c4fd]">
{/* Radial — requires JIT arbitrary values */}
<div className="bg-[radial-gradient(circle,#f7971e,#ffd200)]">Tailwind's JIT compiler (enabled by default in Tailwind 3+) supports arbitrary values in brackets, which means you can use exact hex colors directly in className strings without writing any custom CSS. The generator outputs the exact syntax that the JIT compiler processes correctly.
The most appealing gradients transition between colors that are close on the color wheel. A hue shift greater than 90° often produces a muddy intermediate color. Try pairing colors that are 30–60° apart for a smooth, professional result.
The diagonal direction (135deg) feels contemporary and energetic without being as stark as a horizontal or vertical transition. Most SaaS hero sections you admire use angles between 120° and 150°.
When placing text on a gradient, orient the gradient so the darkest area sits behind your headline. This gives maximum contrast at the most important content and lets you skip adding a text-shadow.
A three-stop gradient with a slightly lighter or more saturated midpoint creates a feeling of luminosity — as if light is hitting the center. Try the Aurora preset for an example.
Linear gradients at shallow angles (10–20deg) look dramatically different on mobile vs desktop because the transition distance changes with container width. Preview your gradient at small widths before shipping.
High-contrast, high-saturation gradients work for hero images and illustrations. For UI components like buttons and cards, reduce saturation by 20–30% so gradients feel polished rather than flashy.
linear-gradient() creates a transition along a straight line at a specified angle. Colors flow from one side of the element to the other. radial-gradient() creates a transition that radiates outward from a central point. Use linear for backgrounds and banners, use radial for spotlight effects, glowing buttons, or circular decorative elements.
CSS gradient functions accept any number of color stops separated by commas. This tool lets you add up to five stops using the Add Color button. In code, you write them sequentially: linear-gradient(135deg, #color1, #color2, #color3). Each stop is evenly distributed by default, or you can specify a position like #color2 40% to control exactly where each transition occurs.
Tailwind ships with bg-gradient-{direction} combined with from-, via-, and to- utilities. For example: className='bg-gradient-to-r from-blue-500 to-purple-600'. For exact hex colors not in Tailwind's palette, Tailwind 3's JIT compiler supports arbitrary values in square brackets: from-[#667eea] to-[#764ba2]. This generator outputs the exact className string you need.
CSS gradients have essentially zero impact on page performance compared to image alternatives. They generate no network requests, have no file size, and browsers render them natively using GPU acceleration. Replacing a PNG background with a CSS gradient typically saves 50–500 KB per image and removes a render-blocking network request. For complex multi-stop gradients on large elements, browsers may repaint more frequently on scroll — use will-change: transform on the parent to promote it to a separate GPU layer.
CSS cannot directly animate gradient color stops because browsers treat them as background images, not individual properties. The most performant workaround is to animate background-position on a gradient that is larger than the container (background-size: 200% 200%), which creates an animated movement effect. Alternatively, layer two gradients and animate the opacity of the top layer using CSS transitions — this is how most animated gradient buttons work.
Whether you're building a landing page hero, styling a button, or adding depth to a card component — a well-crafted gradient elevates any interface from flat to professional. Use the tool above to create your gradient, copy the code, and ship it in minutes.
Free forever · No account · Pure CSS output
Every tool runs entirely in your browser no uploads, no servers, no accounts. Fast, private, and free forever.
Colors, typography, CSS, SVG & more
Generate beautiful color schemes using color theory algorithms monochromatic, complementary, triadic, and more.
Build stunning CSS gradients visually linear, radial, and conic and copy production-ready code instantly.
Discover expert Google Fonts combinations curated for optimal readability and aesthetic harmony.
Generate production CSS visually flexbox, grid, typography, border, and box shadow with live preview.
Upload, edit, optimize, and convert SVG files entirely in your browser. Export clean SVG or React JSX.
Images, accessibility, spacing & readability
Compress images up to 90% smaller WebP, AVIF, JPEG, PNG with filters, cropping, and rotation. 100% private.
Remove image backgrounds instantly using on-device AI no uploads, no account. Download transparent PNG.
Generate a mathematically consistent shadow elevation system and export CSS variables or Tailwind config.
Build a harmonious spacing scale based on mathematical ratios and export it as CSS or Tailwind config.
Preview and compare border radius values in real time across multiple shapes and sizes.
URLs, QR codes, tracking & security
Shorten any URL instantly with browser history, QR code export, and zero server tracking.
Custom QR codes for URLs, WiFi, vCards & more. Add colors, logo, download PNG or SVG.
Build GA4-ready UTM tracking URLs with smart presets, validation, and CSV history export.
Strip 50+ tracking parameters (UTM, fbclid, gclid, msclkid) with before/after comparison.
See how your URL appears on Twitter, Facebook, LinkedIn & WhatsApp. Check OG metadata.