Skip to content
hateitall

Viewport Unit Calculator

Know exactly how many pixels a viewport unit gives on the screens you care about.

Processed locallyIn: NumberOut: Number

Loading tool…

How to use viewport unit calculator

  1. Pick a common screen or type a viewport width and height, or use this window's size.

  2. Enter a value and its unit: px, vw, vh, vmin or vmax.

  3. Read the same length in every other unit.

  4. Use the reference table for 1, 5, 10, 25, 50 and 100 of each unit.

What this tool does

  • Converts between px, vw, vh, vmin and vmax in any direction.
  • Includes phone, tablet, laptop and desktop sizes in CSS pixels.
  • Can read the current browser window's size.

How the result is verified

1vw is always one hundredth of the width and 1vh one hundredth of the height; vmin and vmax use the smaller and larger side. Each stat shows the px size of one unit so you can check by hand.

Frequently asked questions

Does vw include the scrollbar?

Yes. 100vw is the full viewport width including a classic scrollbar, which is why width: 100vw can cause sideways scrolling on desktop browsers that show one.

Why is 100vh too tall on phones?

Mobile browsers size vh as if their toolbars were hidden. Use svh for the height with toolbars showing, or dvh for a value that follows them.

Is my data uploaded to a server?

No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.

px, rem and em both ways with any root size, plus bulk CSS rewrite

Number · CSS→ NumberLight on device

Fluid clamp() between two viewport widths, verified at real widths

Number→ CSSLight on device