background: linear-gradient( 135deg, #6ee7b7 0%, #818cf8 50%, #f472b6 100% ); /* shorthand */ background-image: linear-gradient(135deg, #6ee7b7 0%, #818cf8 50%, #f472b6 100%);
What Is a CSS Gradient?
A CSS gradient is a smooth transition between two or more colours rendered by the browser natively — no image asset required. CSS supports three gradient types: linear, radial, and conic. Gradients are used for backgrounds, buttons, hero sections, dividers, progress bars, charts, and decorative borders. Because they are pure CSS, gradients scale infinitely without blurring, respond to media queries, and add zero network weight.
CSS Gradient Generator Online — What This Tool Does
This free CSS gradient generator lets you visually build linear, radial, and conic gradients and copy production-ready CSS. Drag the angle dial, add unlimited colour stops, pick from 10 presets, and watch the preview update live. Output uses the modern linear-gradient(), radial-gradient(), and conic-gradient() CSS functions — supported in every major browser.
How to Use This Tool
- Pick a gradient type — Linear, Radial, or Conic.
- Drag the angle dial or use direction presets to set the direction (linear/conic).
- Click any colour swatch to open the colour picker, or type a hex code directly.
- Drag the position slider to move each colour stop along the gradient.
- Click + Add Color Stop to add more stops, or ✕ to remove one.
- Choose a preset for a ready-made starting point, then customise from there.
- Click Copy CSS to copy the
backgrounddeclaration.
Gradient Types Explained
- Linear (
linear-gradient()) — transitions colours along a straight line at any angle. Use for banners, hero sections, buttons, and dividers. Specify direction withto right,45deg, or any angle. - Radial (
radial-gradient()) — radiates from a central point outward in a circle or ellipse. Best for spotlight effects, glows, halos, and circular backgrounds. Control the shape withcircle/ellipseand the centre withat top left. - Conic (
conic-gradient()) — sweeps colours around a centre point like a colour wheel. Ideal for pie charts, donut progress rings, spinner animations, and decorative circular patterns. Supported in all modern browsers since 2021.
Common Use Cases
- Hero section backgrounds — two-stop linear gradients give depth without an image.
- Button states — subtle gradient on default state, brighter on hover.
- Card headers — diagonal gradients add visual hierarchy to UI cards.
- Progress / pie charts — conic gradients eliminate the need for SVG charts for simple percentage displays.
- Loading spinners — conic-gradient + CSS animation = lightweight spinner with zero JS.
- Skeleton screens — animated linear-gradient with a moving stop creates the shimmer effect.
- Text effects — combine
background-imagewithbackground-clip: textfor gradient text.
Tips & Tricks
- Use 3+ colour stops for smoother blends — two-stop gradients can show banding. Add an intermediate stop at 50% with a midpoint colour for smoother transitions.
- Avoid pure greys between colours — a gradient from red to blue passes through dull grey at the middle. Pick an intermediate hue (purple) for richer transitions.
- Repeating gradients — switch
linear-gradient()torepeating-linear-gradient()for stripes and patterns. - Animate gradient angle — modern CSS supports animating
background-positionwith a larger-than-element gradient. Setbackground-size: 200%and animate position. - Gradient text — apply gradient as
background-image, then setcolor: transparentandbackground-clip: text. - Performance — gradients are GPU-accelerated. Use them freely. Avoid only when blending many large gradients with opacity layers on mobile.
Linear vs Radial vs Conic — Which to Use
Use linear for directional emphasis (top-to-bottom hero banners, left-to-right progress bars). Use radial for centrepiece focus (spotlight on hero text, circular product photos). Use conic for circular data (pie charts, progress rings, colour wheels). When in doubt, linear is the safest default — it works as a background for nearly any layout.
Related Tools
- Color Picker — pick precise HEX/RGB/HSL colours for gradient stops
- Color Scale Generator — derive tints and shades from a base colour
- Contrast Checker — verify text contrast against your gradient background
- Box Shadow Generator — pair gradients with shadows for depth
- Border Radius Generator — round the corners of gradient elements
Is My Data Sent to a Server?
No. The gradient is generated entirely in your browser — colours, angles, and stops are rendered on a live preview via native CSS. No data is uploaded, logged, or stored. The tool works offline once the page has loaded.