Skip to main content

CSS Gradient Generator

Create beautiful CSS linear and radial gradients with an interactive color stop editor.

CSS Code
background: linear-gradient(90deg, #38ef7d 0%, #11998e 100%);

Colors

0%
100%

Popular Presets

edit_note By Meet Dhameliya
update Updated: Jul 28, 2026
schedule 5 min read

CSS gradients are among the most powerful tools in a web designer's toolkit — but writing gradient syntax from memory is notoriously error-prone. The angle, the colour stops, the percentage positions, the difference between linear-gradient() and radial-gradient(), remembering whether the angle is measured clockwise from the top or from the x-axis — these details slow down the workflow between design intent and working code. The Utility Spark CSS Gradient Generator lets you build gradients visually: add colour stops by clicking the gradient bar, drag them to position, pick colours from a colour picker or enter hex/RGB values, set direction or angle for linear gradients, choose shape and position for radial gradients, and see the live preview update instantly. The tool generates the corresponding CSS code — including the standard CSS3 property — which you can copy and paste directly into your stylesheet or CSS-in-JS. No libraries required, no vendor prefix needed for modern browser targets.

lightbulb When to use this tool

  • check_circle Designing a gradient background for a hero section, card, button, or navigation bar without switching between design tools and a code editor.
  • check_circle Reproducing a gradient from a design file (Figma, Adobe XD) as CSS code by visually matching colours and direction.
  • check_circle Creating a smooth multi-stop gradient for text fill effects (combined with background-clip: text in CSS).
  • check_circle Generating a radial gradient for circular spotlight effects or glowing button hover states.
  • check_circle Experimenting with conic gradients for pie-chart-style decorative elements or angle-based colour transitions.

Why use our tool?

Visual Gradient Builder — Click, Drag, and Pick

Add colour stops by clicking on the gradient bar. Drag stops left and right to adjust their position percentage. Click any stop to open a colour picker and change its colour using hex input, RGB sliders, or the visual colour picker. Remove stops by clicking a delete button. The gradient preview updates in real time with every change.

Linear, Radial, and Conic Gradient Types

Switch between gradient types with one click. Linear gradients support angle input (0°–360°) and directional presets (to right, to bottom, to bottom-right, etc.). Radial gradients support shape (ellipse/circle) and position controls. Conic gradients (supported in all modern browsers since 2020) let you create angle-based colour sweeps for decorative elements.

Production-Ready CSS Output

The generated CSS uses the standard, unprefixed background-image: linear-gradient() syntax that works in all modern browsers without vendor prefixes (-webkit-, -moz-). The code is copy-paste ready — paste it directly into your CSS file, Tailwind config, CSS variable declaration, or inline style attribute.

Gradient Presets for Quick Starting Points

A library of curated gradient presets (warm sunset, ocean blues, forest greens, corporate neutrals, neon accents) provides instant starting points you can customise rather than starting from a plain two-colour gradient every time.

Transparency / Alpha Stop Support

Fade a colour to transparent at any stop using alpha channel control in the colour picker. Essential for creating gradient overlays on images (a semi-transparent dark gradient over a hero photo for text readability), soft edge fades, and glassmorphism effects.

How it works

1

Select the gradient type: Linear, Radial, or Conic.

2

For linear gradients, set the angle using the angle input or click a directional preset button.

3

Click the gradient preview bar to add colour stops at your desired positions.

4

Click any colour stop to open the colour picker — enter a hex code, use RGB sliders, or use the visual picker.

5

Drag colour stops left or right to adjust their position percentages.

6

Copy the generated CSS from the output panel and paste into your stylesheet.

Examples

science Hero Section Background Gradient

Type: Linear | Angle: 135deg
Stops: #667eea 0% → #764ba2 100%
Generated CSS: background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
Use case: Purple-to-indigo diagonal gradient — common in modern SaaS hero sections

science Image Overlay for Text Readability

Type: Linear | Direction: to bottom
Stops: transparent 0% → rgba(0,0,0,0.7) 100%
Generated CSS: background-image: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 100%);
Use case: Apply over a hero image as an overlay using position:absolute — creates a dark fade at the bottom that makes white text readable over any photo

Frequently Asked Questions

Do I need vendor prefixes for CSS gradients? expand_more
No — for all modern browser targets. The standard CSS3 gradient syntax (linear-gradient(), radial-gradient()) without vendor prefixes is supported in Chrome, Firefox, Safari (since version 7), Edge, and all modern mobile browsers. Vendor-prefixed versions (-webkit-linear-gradient, -moz-linear-gradient) were required for browser versions from 2011–2013, which are now an effectively negligible fraction of global traffic. The tool generates unprefixed standard CSS — if you specifically need to support very old browsers, you can add the prefixed versions manually.
What is the difference between linear, radial, and conic gradients? expand_more
A linear gradient transitions colours along a straight line at a specified angle (e.g. left to right, top to bottom, or any diagonal). A radial gradient emanates from a central point outward in an oval or circle shape — useful for spotlight effects and radial glows. A conic gradient transitions colours around a centre point like a colour wheel or pie chart — the colour stops are positioned by angle (0deg to 360deg) rather than linear position. All three are standard CSS and supported in modern browsers.
How do I create a gradient that fades to transparent? expand_more
In the colour picker, set the alpha channel of the target colour stop to 0 (fully transparent). For example, a gradient from #333333 at full opacity to transparent creates a dark-to-clear fade. In CSS, this is represented as: linear-gradient(to bottom, #333333 0%, rgba(51, 51, 51, 0) 100%) or using the transparent keyword: linear-gradient(to bottom, #333333, transparent). Use rgba() or hsla() colour notation when alpha values are involved — the transparent keyword is equivalent to rgba(0,0,0,0) which technically is transparent black and may cause colour banding in some cases.
Can I use a CSS gradient as a text fill? expand_more
Yes, with a CSS combination: set background-image to your gradient, background-clip: text, and color: transparent. This clips the gradient to the shape of the text characters, creating a gradient-filled text effect. Example: .gradient-text { background-image: linear-gradient(90deg, #ff6b6b, #4ecdc4); background-clip: text; -webkit-background-clip: text; color: transparent; }. Note: -webkit-background-clip: text is still needed for Safari support.
How do I reproduce a gradient from a Figma or Adobe XD design? expand_more
In Figma: click the layer with the gradient fill, open the Fill panel, note the colour stops (hex values and positions), the type (linear/radial), and the angle. Enter these same values in the generator. In Adobe XD: select the gradient fill layer, the Properties panel shows gradient type, colours, and direction. For linear gradients, Figma measures angle from the horizontal (same as CSS deg notation), so the values should transfer directly. For slight discrepancies in angles, Figma's 'to top' is 0° CSS equivalent (or 360°), while CSS 0deg points upward by default.

More UI & Design Tools