PX to VW Calculator

Convert a pixel value into viewport width units at a reference width.

LET’S WORK IT OUT

Your inputs

Results update as you type. Check the units before you begin.

View result ↓
YOUR RESULT
—
Value in vw
Adjust the inputs

Your result updates live as you type.

One vw is one per cent of the viewport width, so converting a pixel value to vw means dividing by the viewport it was designed against and multiplying by a hundred. The result is a dimension that scales continuously with the window rather than stepping at breakpoints.

A 400px element designed on a 1440px viewport is 27.778vw. On a 375px phone that same declaration renders at 104px, and on a 1920px monitor at 533px. Continuous scaling is powerful and, applied to type without limits, ruinous.

The practical rule is to use vw for layout dimensions and only ever for font sizes inside a clamp() with a floor and a ceiling. Text sized in raw vw becomes unreadable on narrow screens and absurd on wide ones, and it fails to respond to the reader's font size preference at all.

The formula

vw = px ÷ viewport width × 100
vw
Viewport width units, 1vw = 1% of the width
px
The pixel value at your reference width
viewport
The width you designed against

How to use this calculator

  1. Enter the pixel value from your design.
  2. Enter the viewport width that design was made for.
  3. The gauge shows the value in vw.
  4. Check the rendered sizes on other screens below.

Worked examples

A 400px card on a 1440px design

That is 27.778vw. It renders at 104px on a phone — narrower than most cards should be — and 533px on a large monitor. A min-width or a clamp() is usually needed at both ends.

Fluid type done safely

A heading at 4vw is 15px on a phone and 77px on a wide monitor. Wrapping it as clamp(1.5rem, 4vw, 3rem) holds it between 24px and 48px while keeping the fluid behaviour in the middle.

How to read your score

0–10Small elementIcons, gaps and narrow columns.
10–35Component widthCards, sidebars and form fields.
35–70Major columnA main content area or half-split layout.
70–—Full bleedNear or at full viewport width.

Frequently asked questions

Does vw include the scrollbar?

Yes, which is the classic gotcha. 100vw is the full viewport including a vertical scrollbar, so an element at 100vw can cause horizontal overflow on desktop browsers that reserve scrollbar space.

Should font sizes use vw?

Only inside clamp() or with min and max limits. Raw vw type ignores the reader's font size preference entirely and is an accessibility failure at the extremes.

What are vmin and vmax?

vmin is one per cent of whichever viewport dimension is smaller, vmax of whichever is larger. vmin is useful for elements that must fit on screen in both orientations.

How does vw behave on mobile with a collapsing address bar?

Viewport width is stable during that behaviour; it is vh that jumps. The newer svh, lvh and dvh units exist to address the height case specifically.

Rendered size of common vw values

What each vw value comes to on four screen widths
vw375px phone768px tablet1440px laptop1920px monitor
1vw4px8px14px19px
2vw8px15px29px38px
5vw19px38px72px96px
10vw38px77px144px192px
25vw94px192px360px480px
50vw188px384px720px960px
75vw281px576px1080px1440px
100vw375px768px1440px1920px

Viewport width excludes nothing: 100vw includes any scrollbar gutter.

Related calculators