Gradient CSS Generator
Color ToolsDesign linear, radial, and conic CSS gradients visually with draggable color stops, direction controls, and copy-ready CSS output for any modern browser.. Free, private — all processing in your browser.
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
CSS gradients are one of the highest-leverage visual tools on the web. Two colors and a direction transform a flat rectangle into a hero section, a button into a tactile control, and a card into something worth looking at. Writing gradient CSS by hand works for simple cases, but as soon as you add a third stop, a conic sweep, or a radial falloff, the syntax gets fiddly fast. This generator gives you a visual editor with draggable stops, direction arrows, and live preview, then emits clean CSS in whatever gradient syntax you need.
The three gradient families all live here. Linear gradients draw a line between two points and fill color along it — the workhorse for hero backgrounds, dividers, and button fills. Radial gradients emanate from a point — great for spotlights, glow effects, and soft card shadows. Conic gradients sweep around a center — the foundation of pie charts, progress rings, and modern glassmorphism. The generator lets you toggle between them without losing your color stops, so you can experiment until you find the shape that fits.
Once you are happy, the generator gives you production-ready CSS with vendor prefixes if needed, color stop percentages or lengths, and a background-size value if you want the gradient to tile. Copy a single line into your stylesheet or export as a CSS custom property for a design system. The preview honors the exact same rules your browser will use, so what you see in the tool is exactly what ships.
Gradient CSS Generator — key features
Linear, radial, and conic modes
Switch between gradient types without losing your palette or stop positions.
Drag-to-position color stops
Click to add, drag to reposition, right-click to remove — all in the live preview.
Per-stop color, position, and alpha
Fine-tune each stop with a color picker, percent position, and alpha slider.
Angle and center controls
Set linear angle, radial shape and center, or conic starting angle with precise inputs or visual handles.
Repeating gradient toggle
One click converts the gradient to its repeating variant for stripes and patterns.
Modern color interpolation
Output with in oklch for richer transitions, or stay with sRGB for maximum compatibility.
Copy CSS or custom property
Export a one-liner, a full background shorthand, or a design-system ready custom property.
How to use the Gradient CSS Generator
- 1
Pick a gradient type
Start with linear for most cases, radial for spotlight effects, conic for pie-chart and ring looks.
- 2
Set your colors
Click a stop to open the color picker. Add more stops by clicking empty space on the preview strip.
- 3
Adjust direction or center
Drag the angle dial for linear, the center handle for radial and conic. Snap to common angles with shift.
- 4
Fine tune stop positions
Drag stops along the track or enter exact percentages in the stop list to get the transitions you want.
- 5
Copy the CSS
Click copy to paste a ready line into your stylesheet. Use custom-property mode for design-system export.
Common use cases for the Gradient CSS Generator
Hero and landing backgrounds
- →:
- →:
- →:
Interactive elements
- →:
- →:
- →:
Data visualization
- →:
- →:
- →:
Decorative patterns
- →:
- →:
- →:
Gradient CSS Generator — examples
Sunset linear
Warm two-color
linear 135deg
linear-gradient(135deg, #f97316 0%, #dc2626 100%)
Ocean radial
Blue spotlight
radial at top left
radial-gradient(circle at top left, #0ea5e9 0%, #1e3a8a 100%)
Conic progress ring
75% progress look
conic starting top
conic-gradient(from 0deg, #22c55e 0 75%, #e5e7eb 75% 100%)
Repeating stripes
Diagonal candy stripes
repeating linear
repeating-linear-gradient(45deg, #e2e8f0 0 10px, #f1f5f9 10px 20px)
Glassmorphism sheen
Subtle overlay
linear 180deg, white to clear
linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%)
Technical details
CSS defines three gradient functions. linear-gradient() takes an angle or to-direction keyword followed by color stops: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%). The angle uses compass-style degrees where 0deg is to-top and 90deg is to-right. radial-gradient() takes a shape (ellipse or circle), a size keyword (closest-side, farthest-corner, and variants), a position, and stops. conic-gradient() takes an angle and from-position, sweeping color around a center — useful for pie charts and percentage rings without SVG.
Each function has a repeating variant (repeating-linear-gradient, etc.) that tiles the gradient from the final stop back to the first. Interpolation between stops happens in the sRGB color space by default, which can look muddy when transitioning between saturated hues. The modern CSS Color Module Level 4 syntax allows in oklch interpolation (linear-gradient(in oklch, red, green)) which stays vivid across the transition; modern browsers support it.
Color stops can be positioned by percentage, by length, or omitted to be distributed evenly. Multiple stops can share a position to create hard boundaries (stripes), and each stop accepts its own alpha for soft fades. Combining multiple gradients in one background-image stacks them for mesh-like compositions. The generator outputs all of this cleanly and shows which features are safe everywhere versus which need modern browsers.
Common problems and solutions
⚠Muddy sRGB transitions
Interpolating blue to yellow in sRGB passes through gray. Use `in oklch` or add a vivid midpoint stop.
⚠Overly wide angles
Extremely flat linear gradients (say 2 degrees) produce banding. Stick to common angles or add more stops.
⚠Forgetting background-size
Gradients stretch to fill their element. For tiled looks, set background-size and background-repeat.
⚠Mixed RGBA and HEX
Mixing alpha in some stops and not others produces hard edges. Standardize on rgba or hsla for consistency.
⚠Conic with no starting angle
Conic gradients start at the top by default but many designers want 12 o'clock-like behavior. Specify from-angle explicitly.
⚠Too many stops
More than five stops usually hurts. Remove intermediate stops if the gradient looks noisy.
Gradient CSS Generator — comparisons and alternatives
Writing CSS gradients by hand scales poorly past two stops. Figma exports gradients but not always as CSS, and copying from DevTools does not round-trip cleanly. Dedicated online generators often support only linear gradients or lack alpha. This tool supports all three CSS gradient families, drag-to-edit, modern interpolation modes, and design-system exports. It works in the browser, honors the exact CSS specification browsers implement, and pairs with the palette generator and color picker tools for a complete color workflow.
Frequently asked questions about the Gradient CSS Generator
▶Are conic gradients supported in every browser?
Yes in every modern browser including Safari and Firefox. IE does not support them.
▶How do I animate a CSS gradient?
You cannot animate background-image gradients directly, but you can animate background-position on a large gradient or use CSS @property for custom property interpolation.
▶Can I combine multiple gradients?
Yes. Stack them in background-image separated by commas. The first one appears on top.
▶Why do my colors look muddy?
Default sRGB interpolation can dim saturated colors mid-transition. Try in oklch or add a brighter midpoint stop.
▶What is the best angle for hero backgrounds?
135deg and 45deg are the most pleasing. Pure horizontal or vertical gradients can feel flat and uninteresting.
▶How do I export to Tailwind?
Tailwind supports arbitrary values with bg-[linear-gradient(...)]. For reusable gradients, add them to theme.extend.backgroundImage in tailwind.config.
▶Does the tool support mesh gradients?
Native CSS has no mesh gradient function. You can simulate them by stacking multiple radial gradients at different positions.
▶Are gradients accessible?
They are visual only and do not affect accessibility as long as content contrast is preserved on top of them.
Additional resources
Related tools
All Color ToolsColor Converter
Convert between HEX, RGB, HSL, HSV, CMYK, Lab, LCH color formats
Color Palette Generator
Generate harmonious color palettes from any base color with complementary, analogous, triadic, and monochromatic schemes.
Color Picker
Pick colors interactively and get HEX, RGB, HSL, HSV, and CMYK values with alpha, plus save swatches to build palettes you can copy straight into CSS, Figma, or code.
Color Shades Generator
Generate tints (lighter), shades (darker), and tones (desaturated) from any base color for design systems and UI states.
CSS Animation Generator
Build CSS keyframe animations and transitions with live preview and easing curves
CSS Border Radius Generator
Generate CSS border-radius — from simple rounded corners to organic blob shapes
Learn more
Explore more tools
200+ free tools that run in your browser.
Browse all tools →