When you need this conversion
Turning a fixed design into a fluid one. A hero headline that is 72 px on a 1440 px mockup should shrink smoothly on smaller screens; expressing it in vw (5vw) makes it scale with the window. Designers also use vw to size full-bleed images, gaps and grids that should keep their proportions.
Pick the right viewport width
Convert against the width your design was drawn at. Common artboards are 375 px (phone), 768 px (tablet), 1440 px (laptop and desktop) and 1920 px (large desktop). The same 48 px element is:
- 12.8vw at 375 px
- 6.25vw at 768 px
- 3.33vw at 1440 px
Fluid type done right
Viewport-only font sizes break zoom: pressing Ctrl + doesn’t enlarge them. Accessibility guidelines expect text to scale to 200%, so mix vw with rem and cap it: font-size: clamp(1.25rem, 0.75rem + 2vw, 3rem);. The vw part gives the fluid growth; the rem parts keep zoom working and set sensible limits.
Common mistakes
Using vw for body text. It becomes tiny on phones and huge on wide monitors.
Forgetting the scrollbar. width: 100vw includes the scrollbar on Windows, so it can overflow by 15–17 px. Use width: 100% for full-width blocks.
Going the other way? Use vw to pixels.