← All articles Tutorial

How to Create SVG Wave Backgrounds for Your Website

6 min read
svg waves backgrounds css web design

Wave backgrounds have become a staple of modern web design. They add visual interest to hero sections, break up content blocks, and guide the eye through a page. Unlike raster images, SVG waves are resolution-independent, lightweight, and infinitely customizable.

Why SVG Waves?

Traditional approaches to wave backgrounds often relied on large PNG or JPEG images. These files were heavy, blurry on retina displays, and impossible to animate without JavaScript hacks. SVG solves all of these problems.

An SVG wave is defined by a handful of path coordinates. The resulting file is typically under 2 KB, compared to a raster equivalent that could weigh 50-200 KB. Because the paths are mathematical, they render crisply at any screen size. And since SVG is part of the DOM, you can animate it with CSS transitions or GSAP without any performance penalty.

Using a Generator

The fastest way to create SVG waves is with a dedicated tool. The Wave Generator on graphic.so lets you customize amplitude, frequency, number of layers, and color scheme in real time. Once you are happy with the result, export the SVG code and drop it directly into your HTML.

Here is a typical workflow:

  1. Open the Wave Generator and choose between smooth or jagged wave styles.
  2. Adjust the number of layers. Two or three layers with decreasing opacity create a nice sense of depth.
  3. Pick colors that match your brand. Using semi-transparent fills lets layers blend naturally.
  4. Set the width to your viewport width and the height to something between 100 and 200 pixels.
  5. Export the SVG and place it at the bottom of your hero section using absolute positioning.

The Manual CSS Approach

If you prefer to avoid external SVG files, you can approximate waves using CSS alone. The clip-path property combined with polygon() or ellipse() can create simple wave shapes.

.wave-divider {
  width: 100%;
  height: 80px;
  background: #6366f1;
  clip-path: ellipse(60% 100% at 50% 100%);
}

This produces a subtle curved edge. For more complex, multi-wave shapes, you would still want to use SVG paths, but for a simple section divider this CSS-only technique works well and requires zero additional assets.

Another technique is to use multiple radial-gradient layers stacked to simulate a wave form:

.wave-bg {
  background:
    radial-gradient(ellipse at 25% 100%, #6366f1 0%, transparent 50%),
    radial-gradient(ellipse at 75% 100%, #8b5cf6 0%, transparent 50%);
}

Best Practices

Keep file sizes small. SVG waves should be simple paths with minimal control points. Avoid running a complex illustration through an SVG optimizer and calling it a wave. Aim for under 3 KB per wave element.

Use preserveAspectRatio="none" for full-width waves. This ensures the SVG stretches to fill the container width without distorting the vertical amplitude.

<svg viewBox="0 0 1440 120" preserveAspectRatio="none" class="w-full h-auto">
  <path d="M0,64 C360,120 720,0 1440,64 L1440,120 L0,120 Z" fill="#6366f1" />
</svg>

Layer waves for depth. A single wave looks flat. Stack two or three SVG paths with different opacities and slight vertical offsets to create a rich, dimensional effect. The graphic.so Wave Generator handles this automatically with its layer controls.

Make them responsive. Set the SVG to width: 100% and use a container that constrains the height. On mobile, consider reducing the wave height slightly so it does not dominate small screens.

Animating Waves

For subtle animation, translate the wave horizontally in a loop:

@keyframes wave-drift {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.wave-animated {
  animation: wave-drift 12s linear infinite;
  width: 200%;
}

By doubling the width and using a seamless repeating path, you get an infinitely scrolling wave with pure CSS. No JavaScript required.

Performance Tips

SVG waves are lightweight, but a few things can trip you up. Avoid applying complex CSS filters like blur() to large SVGs on mobile, as this forces the browser to rasterize and re-composite on every frame. If you need a blurred wave, bake the blur into the SVG itself using an <feGaussianBlur> filter, which the browser can optimize more efficiently.

Also avoid placing dozens of wave layers on a single page. Three layers per section is a practical maximum before paint times start to climb.

Wrapping Up

SVG wave backgrounds are one of the simplest ways to elevate a website’s design. Whether you use a generator like the one on graphic.so or hand-code your paths, the key principles are the same: keep files small, layer for depth, and ensure responsiveness. Combine waves with gradients from the Mesh Gradient Generator or patterns from the SVG Pattern Generator to create truly unique section designs.