Skip to content

CSS Gradient Generator

Free

Create CSS gradients visually. Linear, radial, and conic. Add color stops, set direction, copy CSS. Free, browser-based, no signup.

css gradient makergradient css code generatorlinear gradient generator
All Color Tools

Settings guide

Linear gradient direction options:

SyntaxDirection
to rightLeft → Right (0° = bottom to top)
to bottomTop → Bottom (default if omitted)
45degBottom-left → Top-right
135degTop-left → Bottom-right
to bottom rightCorner-to-corner (responsive, not a fixed angle)

Color stop syntax:

  • ·#FF5733 0% — start position
  • ·#FF5733 — evenly distributed when position omitted
  • ·#FF5733 30%, #3B82F6 70% — asymmetric spread
  • ·transparent — fade to transparent

Gradient performance:

  • ·CSS gradients are rendered by the GPU — no performance penalty vs solid colors.
  • ·Avoid very long gradient lists (10+ stops) in animations — recalculation cost increases.
  • ·Use background-attachment: fixed cautiously with gradients — disables GPU compositing.

Format comparison

CSS gradients vs SVG gradients: CSS gradients are simpler and require no markup. SVG gradients are more powerful for complex shapes, gradient along a path, or when the gradient needs to be reused as a fill on text or icons. For background gradients, always use CSS. For icon/text gradients, SVG or the CSS background-clip: text approach.

CSS gradients vs image files: Gradients are resolution-independent, load instantly (no HTTP request), and can be animated. Photographic gradients with complex texture effects still require image files. For everything else, CSS gradients are strictly better.

Linear vs radial vs conic: Linear gradients are the most common — directional transitions for backgrounds and overlays. Radial gradients create light-source effects and circular reveals. Conic gradients are specialized — useful for progress indicators, pie charts, and color wheel visualizations. Most UI needs are covered by linear.

How it works

1

Choose type

Select linear, radial, or conic gradient type.

2

Add color stops

Click on the gradient bar to add stops. Drag to reposition. Use the color picker to set each stop's color and opacity.

3

Set direction

For linear: choose an angle or direction keyword. For radial: set the center point and shape.

4

Copy CSS

Click 'Copy CSS' to get the complete background property value, ready to paste into your stylesheet.

About this format

CSS gradients are smooth transitions between two or more colors defined entirely in code — no image files, no server requests, instant rendering. A CSS gradient can replace a background image on a hero section, add depth to a button, create a frosted-glass effect, or produce complex multi-color backgrounds that would otherwise require a designer and a Photoshop file.

CSS supports three gradient types: `linear-gradient()` (directional, straight-line transitions), `radial-gradient()` (circular or elliptical transitions expanding from a center point), and `conic-gradient()` (transitions around a rotation point, useful for pie charts and color wheels). Each type supports any number of color stops with precise position control.

This generator provides a visual editor where you click to add stops, drag to reposition them, and pick colors using the full color picker — then copies the exact CSS you need. No manual syntax. No guessing at angle values.

Frequently asked questions

How do I create a gradient that fades to transparent?+
Add a color stop with the color keyword 'transparent' or use rgba(r, g, b, 0). Place it at 0% to fade in, or 100% to fade out. Example: linear-gradient(to bottom, #3B82F6, transparent). Avoid fading from a color to transparent in Safari using keywords — use rgba(r, g, b, 0) instead to prevent a gray fringe.
What is the difference between 'to right' and '90deg' in a gradient?+
They produce the same result. 'to right' and '90deg' both make a left-to-right gradient. CSS gradient angles start at 0deg pointing up (to top) and go clockwise: 90deg = to right, 180deg = to bottom, 270deg = to left. 'to right' is more readable; degree values are necessary for non-standard angles like 45deg.
Can I animate a CSS gradient?+
Not directly — the CSS `transition` and `animation` properties cannot interpolate gradient values. The workarounds: animate `background-position` on a larger gradient (efficient), use CSS custom properties with Houdini @property for true gradient animation (limited support), or animate `opacity` between two solid gradient layers.
How do I stack multiple gradients on one element?+
CSS background accepts multiple values separated by commas. The first value is the topmost layer: background: linear-gradient(transparent, black), url('photo.jpg'). This overlays a dark gradient on a photo. You can stack multiple CSS gradients the same way.
Why does my gradient look different on mobile vs desktop?+
Gradient rendering is consistent across browsers, but the angle '45deg' points to an absolute direction. 'to bottom right' adapts to the element's aspect ratio. If your gradient looks correct on a square desktop layout but skewed on portrait mobile, switch from a fixed degree angle to a directional keyword.

Related tools and guides