CSS Gradient Generator
Build linear, radial, and conic CSS gradients with a live preview — perfect for backgrounds, buttons, and gradient text. Drag color stops on the gradient bar, fine-tune opacity and position, start from a preset, then copy the CSS, Tailwind, or HTML when you're done.
Gradient type
How colors are projected across the element.
Tip: repeating gradients need stop positions that stop short of 100% (e.g. last stop at 20%) to actually repeat.
Direction
Quick directions
Shape
Size
Position
From angle
Position
Color stops
Click a stop to edit it. Drag the handles on the gradient bar to reposition. Max 10 stops.
Editing stop
Color
Opacity
Position
Click the bar to add a stop · drag a handle to move it · double-click a handle to remove it.
Gradient functions
- linear-gradient()
- Straight-line blend along an angle
- radial-gradient()
- Blend outward from a center
- conic-gradient()
- Blend rotated around a center
- repeating-*-gradient()
- Tiles the stop pattern
Direction & angle
- 0deg
- to top
- 90deg
- to right
- 180deg
- to bottom
- 270deg
- to left
Color stops
- #f00 0%
- Color + position
- #f00 0%, #f00 50%
- Hard stripe (no blend)
- rgba(0,0,0,0)
- Fade to transparent
- red, orange, gold
- Auto-spaced stops
Common patterns
- Gradient text
- background-clip: text
- Image overlay
- linear-gradient + url()
- Pie chart
- conic + hard stops
- Spotlight
- radial closest-side
What is a CSS gradient?
A CSS gradient is a smooth transition between two or more colors, rendered by the browser as an <image> value. Because gradients are generated in CSS rather than loaded as files, they add zero network requests, scale to any size without blurring, and can be animated or themed with custom properties. You apply a gradient anywhere an image is allowed — most often as background-image, but also on border-image, mask-image, and (with a clip trick) on text.
There are three gradient functions — linear-gradient(), radial-gradient(), and conic-gradient() — and each has a repeating- variant that tiles the color pattern. All three share the same color-stop syntax: a comma-separated list of colors, each with an optional position. This generator writes that syntax for you while you drag stops and tweak the geometry visually.
Designers reach for gradients across the whole interface: hero and section backgrounds, buttons and badges, card surfaces, borders, and eye-catching gradient text. This free CSS gradient maker covers all of them — pick a type, set your colors, and it outputs production-ready code in CSS, Tailwind, or HTML.
How to use this generator
Start with a preset swatch or hit Random to get a working gradient instantly. In the Type tab, choose linear, radial, or conic and set the geometry — drag the angle dial (or pick a quick direction) for linear, choose shape, size, and position for radial, or set the start angle and position for conic. Switch to the Colors tab to edit the selected stop's color, opacity, and position. The fastest way to work is the gradient bar under the preview: click it to add a stop, drag a handle to move it, and double-click a handle to delete it. When it looks right, pick CSS, Tailwind, or HTML and copy — use the hex / rgb / hsl toggle to match your codebase's color style.
Linear, radial, and conic gradients explained
- linear-gradient() — Colors progress along a straight line. Set the line's direction with an angle (
0degpoints up, increasing clockwise) or a keyword (to right,to bottom left). This is the workhorse for backgrounds, buttons, and section dividers. - radial-gradient() — Colors radiate outward from a center point. Control the
shape(circleorellipse), thesize(how far the final stop reaches —closest-sidethroughfarthest-corner), and the centerposition. Ideal for spotlights, glows, and vignettes. - conic-gradient() — Colors rotate around a center point like a clock sweep. Set the start angle with
fromand the pivot withat. With hard stops it draws pie and donut charts; with a full spectrum it becomes a color wheel; faded, it makes convincing angular highlights.
Color stops, positions, and opacity
Each color stop is a color plus an optional position — a percentage along the gradient line (or a degree for conic). If you omit positions, the browser spaces stops evenly; the first sits at 0% and the last at 100%. Two tricks unlock most real-world designs: place two stops at the same position to create a hard edge instead of a blend (perfect for stripes and pie slices), and lower a stop's opacity so it is emitted as rgba()/hsla() to fade to transparent — the standard way to darken the bottom of a hero image for legible text. When fading to nothing, prefer an explicit rgba(r, g, b, 0) of the same color over the bare transparent keyword to avoid a grey tint in Safari.
Using gradients in Tailwind & browser support
Tailwind's built-in bg-gradient-to-* utilities with from-, via-, and to- cover simple two- or three-color linear gradients. For anything beyond that — custom angles, conic gradients, exact stop positions, or per-stop opacity — drop the full function into an arbitrary value: bg-[linear-gradient(90deg,#6366f1_0%,#ec4899_100%)], writing spaces as underscores. The Tailwind tab above generates that class for you. As for support: linear and radial gradients work in every modern browser unprefixed and have for years; conic gradients reached cross-browser baseline in 2021, so they're safe today — add a solid background-color fallback only if you must support very old browsers.
Building the page around your gradient? Pair this tool with our CSS Flexbox Generator for aligning components and the CSS Grid Generator for full page layouts — both export ready-to-paste CSS the same way. Want a patterned or mesh-gradient backdrop instead of a flat gradient? The Background Generator makes grid backgrounds, CSS patterns and mesh gradients.
Frequently asked questions
linear-gradient blends colors along a straight line in a direction you set with an angle (90deg) or keyword (to right). A radial-gradient blends outward from a center point in a circle or ellipse, like a spotlight. A conic-gradient sweeps colors around a center point like the hands of a clock — making it the right choice for pie charts, color wheels, and loading spinners. All three accept the same color-stop syntax.
linear-gradient(90deg, #6366f1 0%, #ec4899 50%, #f97316 100%). The browser blends smoothly between adjacent stops. There is no limit on the number of stops, and you can place two stops at the same position to create a hard color stripe instead of a blend. In this tool, just click the gradient bar to drop in another stop.
0deg points to the top, 90deg to the right, 180deg to the bottom, and 270deg to the left — angles increase clockwise. The keyword equivalents are to top, to right, to bottom, and to left. For rectangular boxes the keyword matches the angle, but corner keywords like to top right always aim exactly at the corner regardless of aspect ratio, which a fixed angle does not.
rgba() or hsla() value. A common pattern is fading an image overlay to nothing: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0)). Note that in Safari the bare transparent keyword means transparent black, which can tint a colored fade grey — fade to an explicit rgba() of the same color with alpha 0 instead. Set any stop's Opacity slider below 100% to do this here.
conic-gradient rotates colors around a center point, which makes it ideal for pie and donut charts, color pickers and hue wheels, percentage and progress rings, and angular glow effects. Set the starting angle with from Ndeg and the center with at position. Placing stops at hard boundaries (e.g. #f00 0deg 25%, #0f0 25% 50%) produces crisp pie slices with no blending.
background-image on the text element, then clip the background to the text and make the fill transparent: -webkit-background-clip: text; background-clip: text; color: transparent. The -webkit- prefix is still required in Safari and Chrome. Toggle the Text preview above to see your gradient applied to type before you copy it.
bg-gradient-to-r with from-/via-/to- stops for simple cases. For full control — custom angles, conic gradients, precise positions, or opacity — use an arbitrary value: bg-[linear-gradient(90deg,#6366f1_0%,#ec4899_100%)], writing spaces as underscores. The Tailwind tab above outputs the ready-to-paste class for the exact gradient you've built.
background-color for very old ones. Gradients are pure CSS — there's no image request and they scale to any size without losing quality.