1. Home
  2. Developer & Security
  3. CSS Gradient Generator

CSS Gradient Generator

Create modern gradients for your website or designs by dragging colors and angles, pick from ready-made presets, then copy the CSS or download a high-resolution background.

100% freeRuns in your browserNo sign-up
Type
Presets
CSS

Gradients in modern design

Gradients are back in modern websites and apps. They add depth and energy to buttons, backgrounds, cards and logos without heavy images that slow pages down. With CSS, a gradient is a single line of code that works in every modern browser.

How to use the generator

  1. Choose a type: linear runs in one direction, radial spreads from the center, conic sweeps around a point.
  2. Set the angle with the slider.
  3. Pick colors and each stop's position, with up to six colors.
  4. Try a preset or hit “Random” for inspiration.
  5. Copy the CSS into your stylesheet, or download a 1920×1080 PNG to use as a background.

Gradient types in CSS

  • linear-gradient(): the most common — perfect for backgrounds and buttons. 90deg runs left to right, 180deg top to bottom.
  • radial-gradient(): great for spotlighting a central area or a glow effect.
  • conic-gradient(): sweeps around a point like a color wheel — for pie charts and artistic effects.

Tips for beautiful gradients

  • Pick neighboring hues on the color wheel (like purple and blue) for a smooth blend.
  • Avoid jumping between complementary colors (like red and green) — the midpoint turns muddy gray. Add an in-between stop.
  • Keep enough contrast between text and the gradient behind it.
  • The copied CSS includes a solid fallback color for very old browsers.

Pull your brand colors from a logo with the Image Color Picker and use them here for an on-brand gradient.

Design tips for better gradients

  • Pick neighboring colors: blending colors close on the color wheel (like purple and blue) looks smooth and modern, while exact opposites can create a muddy gray in the middle.
  • Add a third stop: a slightly lighter middle color makes the transition more vibrant.
  • Mind contrast: if text sits on the gradient, check it's readable over both the lightest and darkest parts.
  • Use sparingly: one standout gradient on a hero or call-to-action beats gradients everywhere.

Match your brand colors

Have a logo or photo whose colors you want to match? Extract its palette with the Image Color Picker, then use it here for a gradient that fits your identity.

Performance

CSS gradients are drawn by the browser: no image downloads, crisp on every screen and only a few characters in size — better for site speed and user experience.

Frequently Asked Questions

How do I add the gradient to my site?

Copy the code and paste it into the CSS rule for your element, such as body or .hero.

Do gradients work in all browsers?

Yes. Linear and radial gradients work everywhere modern; conic gradients have been supported since around 2020.

How do I apply a gradient to text?

Add background-clip: text and color: transparent to the text element after the background.

Why download a PNG?

To use the gradient as a desktop or phone wallpaper, or in design and presentation software.

Can I use gradients commercially?

Yes. The code and images are free to use without restrictions.

Last updated: