CSS Gradient Generator

Design linear and radial CSS gradients with draggable color stops, shareable links, and export to PNG, JPEG, WebP or SVG. Copy production-ready CSS in one click.

Adjust stops and mode
CSS

Export Image

Choose size, then download PNG, JPEG, WebP or SVG.

When do you need a CSS gradient generator?

What this tool does

This CSS gradient generator builds linear and radial gradients with draggable color stops, angle and center controls, and one-click CSS copy. Choose from presets, randomize for inspiration, or share your setup via an encoded URL. Export PNG, JPEG, WebP, or SVG when you need a raster asset instead of pure CSS.

Why you need it

Gradients add depth to flat UI — hero backgrounds, button fills, card overlays, and brand accents. Writing gradient CSS by hand means juggling stop positions, angle syntax, and vendor quirks. A visual editor lets you see the blend in real time and copy production-ready declarations without trial-and-error in DevTools.

Shareable links let teammates open the exact same stop configuration. Creators export image files for social posts where CSS is not an option. All editing stays in your browser.

How to use it

  1. Choose linear or radial gradient and set angle or center position.
  2. Add color stops on the bar, drag to reposition, and pick colors for each stop.
  3. Preview the gradient on a live swatch. Copy the CSS snippet for your stylesheet.
  4. Export PNG, JPEG, WebP, or SVG when you need a raster or vector asset instead of CSS.

Practical examples

  • Hero section: Linear gradient at 135° from deep navy to teal for a landing-page background with background-size: cover.
  • Primary button: Two-stop linear gradient from brand primary to a slightly lighter shade for a subtle dimensional fill.
  • Spotlight badge: Radial gradient centered at 30% 20% to simulate a light source on a circular avatar ring.
  • Social asset: Export 1200×630 PNG for an Open Graph image when the CMS only accepts uploaded files.

How it works

Linear gradients interpolate colors along a line defined by an angle in degrees. Radial gradients spread outward from a center point with optional circle or ellipse shape. Each color stop maps a position (0–100%) to a HEX value; the browser blends between adjacent stops. The tool generates either a shorthand background or explicit background-image: linear-gradient(...) declaration depending on your format toggle.

Share links encode stop colors, positions, mode, and angle into URL parameters so recipients load the same configuration. Image export renders the current preview dimensions to a canvas — verify background-size in your layout since CSS may scale differently than a fixed export.

Common mistakes

  • Too many stops on small elements: Complex gradients on 32px buttons can band on low-DPI screens — simplify to two or three stops.
  • Ignoring contrast over gradients: White text on a light stop fails accessibility — test each region or add a scrim overlay.
  • Assuming export matches CSS scaling: Exported images are fixed dimensions; CSS backgrounds stretch with the container.
  • Hard-coding angles without testing RTL: Gradient direction may feel reversed in right-to-left layouts — verify in both directions.

FAQ

Can I share a gradient with teammates?

Yes. Use the share link feature to encode stop colors and settings in the URL.

Linear vs radial — when to use each?

Linear gradients flow along a line — great for headers and buttons. Radial gradients radiate from a center — ideal for spotlights and circular badges.

Do exported images match the CSS preview?

Exports capture the current preview dimensions. CSS uses background-size rules — verify sizing in your layout.

Is there a limit on color stops?

Add multiple stops for smooth blends. Very complex gradients may need simplification for older browsers.

Does this work offline?

After the page loads, core editing works without network access.

Related tools