CSS Gradient Generator
The CSS Gradient Generator builds linear, radial, conic, repeating and mesh/aurora gradients with a live visual editor — pick your colours, drag the stops, and copy production-ready CSS, a Tailwind class, or a PNG.
How to Use
- 1
Pick a gradient type: linear, radial, conic, repeating linear, repeating radial, or mesh/aurora — the live preview updates as you change anything.
- 2
Edit the colour stops: click a colour swatch to change it, drag the position slider to move it, and set its opacity. Add stops (up to 6) or remove them (minimum 2).
- 3
Set the geometry: angle for linear and conic gradients, shape (circle or ellipse) and centre position for radial and conic gradients.
- 4
For mesh/aurora gradients, move and resize the coloured blobs over the base colour — each blob becomes a layered radial-gradient in the exported CSS.
- 5
Or load a preset in one click: Sunset, Ocean, Aurora, Candy, Dark hero, Mesh blobs, Forest, or Royal — then tweak it to taste.
- 6
Copy the CSS background rule, the Tailwind arbitrary-value class, or the gradient-text snippet — or download the gradient as a PNG in your chosen size.
Frequently Asked Questions
What is a CSS gradient?
Linear vs radial vs conic — when should I use each?
What is a mesh gradient?
Do gradients need vendor prefixes in 2026?
Do gradients slow down my page?
Can I use gradients in Tailwind CSS?
How do I make gradient text?
How do I make a gradient border?
How many colour stops should I use?
Is my gradient uploaded anywhere?
Generative Answer & AI Documentation
What is the CSS Gradient Generator?
A CSS gradient is a smooth blend between two or more colours, painted by the browser as a background-image value — for example linear-gradient(135deg, #6366f1, #ec4899). It is not an image file: there is nothing to download, it stays sharp at any screen size, and it can be layered, animated, and clipped to text. This tool is a visual editor for those values. You choose the gradient type, set two to six colour stops with individual positions and opacity, adjust the angle or centre point, and the tool writes the exact CSS for you — plus a Tailwind arbitrary-value class, a gradient-text snippet, and a PNG render for places CSS cannot go. A dedicated mesh mode builds the layered blurred-blob backgrounds that define the 2026 hero look, exported as plain layered radial-gradients.
Why use CSS Gradient Generator offline?
Hand-writing gradients means juggling angles, stop positions, colour formats and comma placement — and a single misplaced comma breaks the whole declaration. A visual editor removes that friction: you see the blend change as you drag, and the output is always valid CSS. Doing it client-side matters too. Gradients are often built from brand colours, and many online generators send your input to a server to generate the code. This tool runs entirely in your browser tab, so your palette never leaves your device, and it works offline once the page has loaded. There is no account, no watermark, and no limit on how many gradients you make.
When should you use this tool?
Use it whenever a flat colour feels too plain: a hero-section background, a call-to-action button, a card hover state, a section divider, a loading skeleton, or a social-media graphic. Reach for it when you need a background that scales — a gradient looks identical on a phone and a 4K monitor, where a photographic background would need multiple resolutions. Use the mesh mode for dark-mode hero sections and landing pages where you want depth without a photograph. Use the PNG export only when CSS is not an option — slide decks, email templates, and design tools — and prefer the CSS everywhere else, because it is smaller, sharper, and editable.
Key Benefits
- Zero downloads: a gradient is painted by the browser, so it costs no HTTP requests and no image bytes — unlike a photographic background.
- Infinitely scalable: gradients stay perfectly smooth at any size, from a phone screen to a billboard-width hero.
- Six gradient types in one editor: linear, radial, conic, repeating linear, repeating radial, and mesh/aurora — most free generators offer only linear.
- Copy-ready output in three forms: a plain CSS background rule, a Tailwind arbitrary-value class, and a gradient-text snippet with the required -webkit- prefix included.
- PNG export for non-web uses: render the exact gradient as a 1920×1080, 1440×900, 1080×1080 or 800×600 image, right in the browser.
Common Use Cases
- Hero-section backgrounds: a deep linear or mesh gradient gives a landing page depth without a photograph or a large image file.
- Gradient text for headlines: clip the gradient to the glyphs with background-clip: text for a headline that stands out without an image.
- Buttons and calls to action: a two-stop linear gradient with a hover-state angle change is a cheap, reliable way to make a button feel designed.
- Dark-mode glows: a radial gradient behind a card or heading adds a soft spotlight that flat dark backgrounds cannot.
- Mesh/aurora hero backgrounds: layered radial-gradient blobs over a dark base — the defining background look of 2026 landing pages.
Developer Notes & Best Practices
Gradient design trends in 2026 are dominated by three looks: mesh/aurora backgrounds (layered radial blobs over a dark base), glassmorphism (a translucent panel over a gradient, using backdrop-filter: blur), and subtle two-stop linear gradients with low saturation for section backgrounds. The mesh look works because the blobs are soft — each radial gradient fades to transparent by 70%, so overlaps blend instead of banding. Keep blob colours in the same family or neighbours on the colour wheel (pink, violet, blue) for a calm result; complementary colours (orange against blue) create energy but can look muddy where they overlap. For gradient text, keep the text large and bold — thin text over a busy gradient is hard to read — and always check the contrast where the text sits: put a dark overlay or a solid panel behind text on a light gradient, and a light text colour on a dark gradient. A practical rule: test the gradient at the size it will actually render, because a blend that looks smooth in a small preview can show banding on a full-screen hero. If you see banding, add a third stop between the two colours, or a subtle noise overlay. For borders, use border-image or a wrapper element with padding: a 1px gradient border is done with a padded outer element carrying the gradient and an inner element carrying the background colour. For animation, animate background-position on a gradient that is larger than its element (background-size: 200%) — do not animate the gradient function itself, because browsers cannot interpolate between two different gradient values smoothly.
Linear vs radial vs conic — when to use each
| Type | How it blends | Best for | Watch out for |
|---|---|---|---|
| Linear | Along a straight line at an angle | Hero backgrounds, buttons, section fades | A 0°/180° blend can look like a flat two-tone split — use a diagonal angle |
| Radial | Outward from a centre point | Glows, spotlights, vignettes, dark-mode accents | A small centre point makes a hard ring — keep the first stop wide |
| Conic | Around a centre point, like a pie chart | Colour wheels, pie fills, checkerboard and starburst patterns | The seam where 0° meets 360° shows unless the first and last stops match |
| Repeating linear | The same linear blend tiled into stripes | Striped backgrounds, progress bars, subtle textures | A stop gap at the cycle edge creates a hard line — that is the point, but check it is intentional |
| Repeating radial | The same radial blend tiled into rings | Target rings, ripple effects, retro patterns | Rings get thin fast — keep the cycle wide enough to see |
| Mesh / aurora | Layered soft radial blobs over a base | 2026 hero backgrounds, dark landing pages | Too many blobs or hard edges turn aurora into noise — keep blobs soft and few |
- Start with two or three stops: a clean blend beats a muddy one, and you can always add a stop where the transition feels abrupt.
- Check text contrast on the gradient, not just on a flat colour — sample the lightest and darkest points under the text and test both.
- Prefer CSS over the PNG on the web: the CSS is smaller, sharper at every size, and editable, while the PNG exists for decks, email, and design tools.
- Keep mesh blobs soft and few: three or four blobs fading to transparent by 70% give the aurora look; more blobs or harder edges turn it into noise.
Common Mistakes
- Forgetting a background-color fallback: if a gradient fails to load or the browser is old, the element shows the fallback colour — set one that matches the gradient's dominant tone.
- Using too many stops: six colours squeezed into one blend usually look muddy — three well-chosen stops beat six random ones.
- Putting body text over a busy gradient: gradient text works for short, large headlines, but paragraphs need a solid or near-solid background for legibility.
- Writing Tailwind arbitrary values with spaces: bg-[linear-gradient(135deg, #6366f1, #ec4899)] is invalid — spaces must become underscores, exactly as this tool outputs.
Limitations
Gradients are painted, not photographed, so they cannot reproduce photographic detail — a gradient can suggest a sunset, not show one. Very subtle blends between near-identical colours can show banding on some displays, especially on large flat areas; adding an intermediate stop or a faint noise overlay is the usual fix. Repeating gradients tile a fixed pattern, so a mistake in one stop repeats across the whole element. The PNG export renders the gradient as a raster image: it is fixed at the chosen resolution and cannot be edited as CSS afterwards. Conic gradients need a browser from the last few years — every current browser supports them, but very old browsers fall back to the element's background-colour, so set a sensible background-color underneath as a fallback.
Structured Input/Output Example
Type: mesh / aurora Base colour: #0f0a1e Blob 1: #ec4899 at 18% / 22%, size 75% Blob 2: #3b82f6 at 82% / 30%, size 70% Blob 3: #8b5cf6 at 55% / 78%, size 80%
background-color: #0f0a1e; background-image: radial-gradient(circle 75% at 18% 22%, rgba(236, 72, 153, 0.85) 0%, transparent 70%), radial-gradient(circle 70% at 82% 30%, rgba(59, 130, 246, 0.85) 0%, transparent 70%), radial-gradient(circle 80% at 55% 78%, rgba(139, 92, 246, 0.85) 0%, transparent 70%);
Related Tools
Color Converter
Color converter: translate colors between HEX, RGB, HSL and OKLCH with a live preview swatch. Type a hex code or pick visually, then copy clean CSS.
HEX to RGB Converter
Hex to RGB converter: turn any hex color code into red, green, and blue channel values. Handles 3-digit, 6-digit, and 8-digit hex with alpha.
RGB to HEX Converter
RGB to hex converter: turn RGB channel values into compact hex codes like #3b82f6 in one step. Free, offline, private.
RGB to HSL Converter
RGB to HSL converter: translate RGB colors into hue, saturation, and lightness — the way humans think about color. Build hover states and palettes easily.
HSL to RGB Converter
HSL to RGB converter: turn hue, saturation, and lightness into RGB channel values for tools and APIs that only speak RGB. Free, offline, instant.
CSS Beautifier
CSS beautifier: untangle minified stylesheets into readable CSS — one rule per line, properties indented, selectors aligned. Free, offline, private.
CSS Box Shadow Generator
CSS box shadow generator: build layered shadows visually — presets, 3-background preview, CSS + Tailwind output, edit an existing shadow. Free, offline.