CSS Wave Divider Generator
Generate SVG wave shapes for section separators — 5 wave types, custom amplitude and color, live preview, copy SVG + CSS
Preview
SVG Code
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none">
<path d="M 0 120 L 0.0 60.0 L 15.0 53.7 L 30.0 47.6 L 45.0 41.8 L 60.0 36.5 L 75.0 31.7 L 90.0 27.6 L 105.0 24.4 L 120.0 22.0 L 135.0 20.5 L 150.0 20.0 L 165.0 20.5 L 180.0 22.0 L 195.0 24.4 L 210.0 27.6 L 225.0 31.7 L 240.0 36.5 L 255.0 41.8 L 270.0 47.6 L 285.0 53.7 L 300.0 60.0 L 315.0 66.3 L 330.0 72.4 L 345.0 78.2 L 360.0 83.5 L 375.0 88.3 L 390.0 92.4 L 405.0 95.6 L 420.0 98.0 L 435.0 99.5 L 450.0 100.0 L 465.0 99.5 L 480.0 98.0 L 495.0 95.6 L 510.0 92.4 L 525.0 88.3 L 540.0 83.5 L 555.0 78.2 L 570.0 72.4 L 585.0 66.3 L 600.0 60.0 L 615.0 53.7 L 630.0 47.6 L 645.0 41.8 L 660.0 36.5 L 675.0 31.7 L 690.0 27.6 L 705.0 24.4 L 720.0 22.0 L 735.0 20.5 L 750.0 20.0 L 765.0 20.5 L 780.0 22.0 L 795.0 24.4 L 810.0 27.6 L 825.0 31.7 L 840.0 36.5 L 855.0 41.8 L 870.0 47.6 L 885.0 53.7 L 900.0 60.0 L 915.0 66.3 L 930.0 72.4 L 945.0 78.2 L 960.0 83.5 L 975.0 88.3 L 990.0 92.4 L 1005.0 95.6 L 1020.0 98.0 L 1035.0 99.5 L 1050.0 100.0 L 1065.0 99.5 L 1080.0 98.0 L 1095.0 95.6 L 1110.0 92.4 L 1125.0 88.3 L 1140.0 83.5 L 1155.0 78.2 L 1170.0 72.4 L 1185.0 66.3 L 1200.0 60.0 L 1200 120 Z" fill="#3B82F6" />
</svg>CSS Positioning
.wave-divider {
position: relative;
width: 100%;
overflow: hidden;
line-height: 0;
}
.wave-divider svg {
display: block;
width: 100%;
height: 120px;
}Usage: Copy the SVG code and paste it inside a .wave-divider container. Apply the CSS to position it between sections. The preserveAspectRatio="none" attribute makes the wave stretch to full width.
You need a smooth wave that separates your hero from the features section. Writing SVG path data by hand — calculating sinusoidal coordinates, choosing control points for Bézier curves, getting the amplitude and frequency just right — is tedious and error-prone. This tool generates wave dividers visually: pick a shape, adjust amplitude and frequency, set your color, and copy the SVG and CSS instantly.
Why SVG Waves for Section Dividers
CSS can produce simple angled or curved section separators with clip-path or border-radius tricks, but smooth multi-period waves require SVG paths. An inline SVG wave scales perfectly at any viewport width without pixelation or performance cost — and because the fill color is set directly in the fill attribute, the wave seamlessly connects the background color of the section above to the background of the section below.
Wave dividers are used across modern landing pages, SaaS marketing sites, and portfolio pages to:
- Create visual rhythm between sections
- Soften hard edges between color zones
- Add depth and layering without images
- Guide eye movement down the page
Wave Types Explained
Sine Wave
The classic smooth wave produced by the mathematical sine function. The path is sampled at many points along y = A·sin(2πfx/W) where A is amplitude, f is frequency, and W is total width. Use preserveAspectRatio="none" to stretch the fixed-viewBox SVG to any container width without distortion.
<!-- Sine wave divider example -->
<div class="wave-divider">
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1200 120" preserveAspectRatio="none">
<path d="M 0 120 L 0 60 ..." fill="#3B82F6"/>
</svg>
</div>
Triangle Wave
A sharp zigzag pattern made of alternating peaks and valleys. Unlike sine, the transitions are linear — useful for a more geometric, angular aesthetic.
Sawtooth Wave
Rises steeply, drops instantly, repeats. Produces an asymmetric, edgy look suited for bold design systems.
Steps Wave
Horizontal plateaus connected by vertical drops — a staircase pattern. Works well for layered, structured layouts.
Custom Bezier
Smooth S-curves using cubic Bézier control points. More exaggerated than sine at the same amplitude, giving a stronger wave impression.
How to Use the Generated SVG
Basic Usage
<section style="background: #ffffff;">
<p>Content above the wave</p>
</section>
<!-- Wave divider -->
<div class="wave-divider">
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1200 120" preserveAspectRatio="none">
<path d="M 0 120 L 0 60.0 L 60.0 ..." fill="#3B82F6"/>
</svg>
</div>
<section style="background: #3B82F6;">
<p>Content below the wave (same color as wave fill)</p>
</section>
.wave-divider {
position: relative;
width: 100%;
overflow: hidden;
line-height: 0;
}
.wave-divider svg {
display: block;
width: 100%;
height: 120px;
}
Key Technique: Color Matching
The wave SVG fill color must match the background color of the section below it (or above it if flipped). If your lower section has background: #3B82F6, set the wave fill to #3B82F6. This makes the wave appear to organically connect the two sections.
Flip for Reversed Direction
Toggle “Flip Vertical” to reverse the wave — useful when the wave should dip into the section above rather than rising from it. The flip applies a CSS transform: scale(1, -1) on the SVG path.
Responsive Behavior
The preserveAspectRatio="none" attribute is critical for responsive waves. Without it, the SVG would maintain its aspect ratio and leave gaps on wide screens. With it, the SVG stretches horizontally to fill any container while maintaining the fixed height.
/* Make the wave scale with the viewport */
.wave-divider svg {
display: block;
width: 100%;
height: clamp(60px, 10vw, 200px); /* Responsive height */
}
Tailwind CSS Integration
<!-- Tailwind: wave container -->
<div class="relative w-full overflow-hidden leading-[0]">
<svg class="block w-full h-[120px]"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1200 120"
preserveAspectRatio="none">
<path d="..." fill="#3B82F6"/>
</svg>
</div>
Layering Multiple Waves
You can overlay two waves with slight offsets to create a layered effect:
<div class="wave-divider" style="position: relative; height: 150px;">
<!-- Back wave (lighter, slightly offset) -->
<svg style="position: absolute; bottom: 0; opacity: 0.4;"
viewBox="0 0 1200 120" preserveAspectRatio="none">
<path d="..." fill="#3B82F6"/>
</svg>
<!-- Front wave -->
<svg style="position: absolute; bottom: 0;"
viewBox="0 0 1200 120" preserveAspectRatio="none">
<path d="..." fill="#2563EB"/>
</svg>
</div>
Animating Wave Dividers
/* Scrolling wave animation */
.wave-divider svg {
animation: wave-scroll 8s linear infinite;
}
@keyframes wave-scroll {
0% { transform: translateX(0); }
100% { transform: translateX(-50%); }
}
For the animation to loop seamlessly, use a viewBox twice as wide (viewBox="0 0 2400 120") and repeat the wave pattern twice inside it.
Performance Considerations
SVG waves inline in the HTML render immediately without an HTTP request. For waves used on multiple pages, consider:
- Inline SVG — fastest for single use, no extra request
- External SVG via
<img>— cacheable, butfillmust be set in SVG file - CSS
mask-imagewith data URI — flexible fill from CSS, slightly more complex setup background-image: url()— simplest to use, but can’t change color via CSS
For landing pages and single-section dividers, inline SVG (what this tool generates) is the recommended approach.
Frequently Asked Questions
How do I make a wave that fills the full width of the screen?
Set the container to width: 100% and the SVG to width: 100%. The preserveAspectRatio="none" attribute in the SVG ensures it stretches to fill any width. No JavaScript needed.
Why does my wave show a gap between the SVG and the section below?
This is usually caused by the browser adding a small whitespace below inline SVG (because SVG is treated as inline element). Add display: block to the SVG, or set line-height: 0 on the container.
Can I animate the wave?
Yes. The simplest approach is to animate translateX on a wave that’s twice the viewBox width. More complex animations can use CSS @keyframes on the SVG path’s d attribute, but browser support for path morphing without JavaScript is limited.
Can I use multiple waves on the same page? Yes, each wave is an independent SVG element. Use different amplitudes, frequencies, or colors for variety while keeping a consistent visual language.
Does the wave work in all browsers?
SVG and preserveAspectRatio are supported in all modern browsers. The wave will render correctly in Chrome, Firefox, Safari, and Edge.
Is my design data sent to a server? No. All wave generation happens in your browser using JavaScript. No SVG, color, or configuration data is transmitted to any server.