Mesh Gradient Generator

Create soft, blended color backgrounds in seconds. Drag the dots, pick your colors, and copy the CSS or download the image.

Drag the dots to move each color.

What Is a Mesh Gradient?

A normal gradient fades between two colors in a straight line. A mesh gradient blends many colors across a surface. The result looks soft, organic, and layered.

Designers use mesh gradients for hero sections, app backgrounds, posters, and social graphics. They add depth without needing a photo.

How to Use This Mesh Gradient Generator

You can get a good result in under a minute.

  1. Pick the number of colors. Use the Colors slider to choose how many color points you want.
  2. Drag the dots. Each dot on the preview is one color. Move it, and the gradient reshapes instantly.
  3. Edit the colors. Change any hex code in the color boxes below the preview.
  4. Adjust the spread. The Spread slider controls how far each color reaches before it fades out.
  5. Choose a shape. Pick the canvas shape, such as Square (1:1), to match where you’ll use it.
  6. Export. Click Copy CSS for web use or Download PNG for an image file.

Not sure where to start? Hit Randomize for a fresh combination. Hit Reset to go back to the default.

Features at a Glance

  • Draggable color points for direct control over placement
  • Spread control to make blends tighter or softer
  • Editable hex codes so you can match your brand colors
  • Randomize button for quick inspiration
  • Live CSS output you can copy with one click
  • PNG download for use outside the browser

What the CSS Output Actually Does

The code this tool produces is plain CSS. There is no JavaScript and no image file to load.

Here is the structure it uses:

background-color: #9a16ac;
background-image:
  radial-gradient(at 34% 46%, #581f61 0px, transparent 60%),
  radial-gradient(at 37% 28%, #e673bc 0px, transparent 60%),
  radial-gradient(at 46% 58%, #e97383 0px, transparent 60%),
  radial-gradient(at 74% 64%, #f48f55 0px, transparent 60%);

Here is how to read it:

  • background-color is the base layer. Every other color sits on top of it.
  • Each radial-gradient is one color point. The at 34% 46% part is the dot’s position.
  • transparent 60% is the spread. Each color fades to nothing at that distance, so the layers blend into each other.

Move a dot and the percentages change. Change the spread and the 60% changes. Once you see this pattern, you can fine-tune the code by hand.

One honest note: true mesh gradients in design tools like Figma or Illustrator use a grid of control points. CSS has no native mesh gradient. Stacking radial gradients is the standard way to get a very similar look on the web.

How to Add the Gradient to Your Website

Paste the code into any element’s CSS. For example, a hero section:

.hero {
  min-height: 100vh;
  background-color: #9a16ac;
  background-image:
    radial-gradient(at 34% 46%, #581f61 0px, transparent 60%),
    radial-gradient(at 74% 64%, #f48f55 0px, transparent 60%);
}

Give the element a height. A gradient has nothing to show on an element with no size.

CSS gradients are drawn by the browser, so they add no image download. They also scale to any screen size without getting blurry.

When to Use CSS and When to Use PNG

Use the CSS When:

  • You want a fast-loading website background
  • The element changes size on different screens
  • You want to tweak colors later in your code

Use the PNG When:

  • You’re making social media posts, thumbnails, or banners
  • You need a wallpaper or presentation background
  • You’re working in a tool that doesn’t accept CSS, like Canva or Keynote

Tips for Better Mesh Gradients

These come from common design practice, and they save a lot of trial and error.

Keep Your Colors Related

Neighboring colors on the color wheel blend cleanly. Purple, pink, and orange, like the preview above, work well together. Opposites such as red and green can turn muddy where they meet.

Use Three to Five Colors

More colors do not mean a better gradient. Too many points can look busy and hard to control.

Add One Dark and One Light Point

A single deep tone and a single bright tone create depth. A gradient with all mid-tones looks flat.

Lower the Spread for More Definition

A small spread leaves distinct color patches. A large spread melts everything into a soft haze. Try both and compare.

Check Text Contrast

Text on a bright gradient can be hard to read. WCAG recommends a contrast ratio of at least 4.5:1 for normal body text. If your text fails, add a semi-transparent dark overlay or put the text on the darkest area of the gradient.

Match Your Brand

Paste your brand hex codes into the color boxes. Then use Randomize only to move the positions, not to replace your palette.

Where Mesh Gradients Work Best

  • Website hero sections and landing pages
  • App and dashboard backgrounds
  • Login and onboarding screens
  • Social media posts and story backgrounds
  • Presentation slides
  • Book covers, posters, and album art
  • Phone and desktop wallpapers

Frequently Asked Questions

Can I Use My Own Brand Colors?

Yes. Click any color box and enter your hex code. The preview updates right away.

What Is the Spread Setting?

Spread sets how far each color travels before it fades to transparent. A higher number gives softer, wider blends. A lower number gives tighter color patches.

Does the CSS Work in All Browsers?

The code uses radial-gradient, which all current major browsers support, including Chrome, Firefox, Safari, and Edge.

Why Does the CSS Version Look Slightly Different From My PNG?

Browsers and image tools can render gradients a little differently. Small differences are normal. If you need exact pixels, use the PNG.

How Do I Stop My Text From Getting Lost on the Gradient?

Check the contrast. Use light text on dark areas and dark text on light areas. You can also place a subtle overlay between the background and the text.

Can I Save a Gradient and Come Back to It Later?

Copy the CSS and store it in your project or a notes file. The hex codes and percentages in the code are enough to rebuild the same gradient.

What If I Don’t Like the Result?

Click Randomize to try a new layout, or Reset to start from the default.