SVG Wave Background: Why It Looks Different per Screen

Contents
You built a wave-shaped SVG, dropped it between landing page sections, and the curve you saw in the tool doesn't match what's on your live site. On a big monitor the wave spreads out gently. On a narrow screen the same code looks pinched and spiky.
That difference isn't a bug in your code. It happens because an SVG's internal coordinate system and its actual rendered width are two different values. Do a little math before you paste anything, and you can predict exactly how it will look on your site.
Summary ① A wave SVG stretches to 100% of its container's width, but its height is a fixed number, so it stays the same no matter how wide the screen gets. ② You can calculate the "actual width per wave" yourself by dividing the section's rendered width by the number of waves. ③ If that value is much larger than the curve's amplitude, the wave looks gentle. If it's similar or smaller, it looks spiky.
The problem: why the preview and the real thing don't match
You get the curve looking right in the wave generator, copy the SVG code, and paste it into your site. Then you open it on a desktop monitor and the waves lie flat and spread out. Open the same page on your phone and they're tight and sharp.
Nothing about the color, height, or curve values changed, so it's easy to assume the code broke. It didn't. This is just how wave SVGs are built to work.
The cause: width stretches to fit, height stays fixed
These wave SVGs usually have an internal coordinate system like viewBox="0 0 1440 height". 1440 is a common desktop screen width, and the curves are spaced evenly across that coordinate system, one per wave.
At the same time, the <svg> tag has something like width="100%" and height="180" — the height is a hard-coded number. Width is a percentage, so it keeps growing with the parent element. Height stays at the same pixel value no matter how wide the screen is.
Width flexes, height doesn't. So the wave shape inside the coordinate system only gets squashed or stretched horizontally as the screen changes. Wider screens give each wave more horizontal room, which makes it look gentle. Narrower screens squeeze that room down, which makes it look steep and spiky by comparison.
How to check: do the math first
You don't need the tool open to figure this out. Two numbers are all you need: the actual rendered width of the section where the wave goes, and how many waves you want.
- Use your browser's developer tools (Inspect Element) to find the actual rendered width (px) of the section you're adding the wave to.
- Divide that by the number of waves you want. If the section is 1200px wide and you have 3 waves, each wave gets 400px of width.
- Compare that 400px to the amplitude value you want. At 40px amplitude, the width is 10 times the amplitude, so it looks quite gentle. At 150px amplitude, the width and amplitude are close, so it looks spiky.
Even with the same wave count and amplitude, mobile and desktop calculate this ratio separately because the section widths differ. Tune it for desktop only, and mobile may look sharper than you expected.
Check it with our tool. If measuring and dividing widths every time sounds like a chore, the preview in this tool is a real SVG that stretches to its parent width. Narrow your browser window or open it on your phone and you can see how much it gets squashed right away.
Free · No signup · Copy the SVG code right in your browser

Where people get stuck
| Symptom | Cause |
|---|---|
| Waves look flat and gentle on a large monitor | The width stretches, so each wave gets much more width than its amplitude |
| Waves look spiky and tight on mobile | The width shrinks, so each wave gets less room and the curve looks steep relative to amplitude |
| Wave height stays the same no matter the screen width | The height value is a fixed number, not a percentage |
| You raised the curve (amplitude) but the value won't go higher | The amplitude cap is automatically limited by the height value |
Wrapping up
A wave SVG looking different on different screens isn't a code error. It's normal behavior from a structure where width stretches by percentage and height is locked to a fixed number. Change the screen width and the ratio per wave changes with it.
Before you paste it into your site, divide the section width by the wave count and compare that to the amplitude. That gives you a good read on how it will actually look. Work out the numbers for desktop and mobile separately, and you'll avoid most of those surprise shape shifts.
Free · No signup · Copy the SVG code right in your browser
Frequently asked questions
How do I calculate the actual width of one wave?
Divide the section's actual rendered width (px) by the number of waves. For example, if the section is 1440px wide and you set 3 waves, each wave takes up about 480px of width. The larger that value is compared to the curve's amplitude, the gentler the wave looks.
Does the same principle apply to wave SVGs I got somewhere else?
Yes, as long as the structure is the same: the actual rendered width grows or shrinks relative to the internal coordinate system width (the third number in viewBox), while the height stays fixed. To be sure, check what the viewBox value is and what the width and height attributes are each set to in the code.
Why can't I raise the curve (amplitude) as high as I want?
Once the amplitude gets close to half the height, the wave's peaks and troughs push past the top and bottom edges and the shape breaks. So the tool automatically caps the amplitude based on the height value. Increase the height first, and you can raise the amplitude further.
This article was adapted from our Korean original. Read the Korean original