Skip to content
Calculator Tools
Web Development Calculators

Viewport Units Calculator

Convert between pixels and vw, vh, vmin and vmax for a given viewport size.

Enter values

Results update as you type.

Result

In vw

22.2222 vw

On mobile, prefer dvh over vh — it accounts for the browser chrome appearing and disappearing as you scroll.

CSS value
22.2222vw
In vh
35.5556 vh
In vmin
35.5556 vmin
In vmax
22.2222 vmax
Viewport aspect ratio
1.6

About the Viewport Units Calculator

Convert between pixels and vw, vh, vmin and vmax for a given viewport size.

Also known as: vw to px, vh calculator, px to vw, viewport width units, vmin vmax.

How to use this calculator

  1. Enter viewport width, viewport height, convert and the other fields.
  2. The result updates instantly as you type — press Calculate (or Enter) at any time.
  3. Review the breakdown shown under the main result.
  4. Use Copy result or Share to save the answer or send a link with your inputs.

Formula

1vw = viewport width ÷ 100 · 1vh = viewport height ÷ 100

Worked example

Using the values pre-filled in the calculator above:

  • Viewport width = 1,440 px
  • Viewport height = 900 px
  • Convert: Pixels → viewport units
  • Pixels = 320 px

the calculator returns:

  • In vw: 22.2222 vw
  • CSS value: 22.2222vw
  • In vh: 35.5556 vh
  • In vmin: 35.5556 vmin