Viewport Unit Calculator

Type a length such as 50vw or 300px and pick a screen. See it in pixels and in every viewport unit, including the svh, lvh and dvh units phones need.

How it works

Each viewport unit is one hundredth of a side of the browser window. 1vw is 1% of the width and 1vh is 1% of the height. vmin uses the shorter side and vmax the longer one.

Phones add a twist: the address bar and tool bar slide away as you scroll, so the window has two heights. svh is measured with the bars showing, lvh with them hidden, and dvh follows whichever is true at the moment. Plain vh uses the hidden-bars height in current browsers.

Type the height of those bars to see the three apart. The sums run in your browser.

How to use it

  1. 1 Type a length with its unit, such as 50vw, 100dvh or 300px.
  2. 2 Pick a screen from the list, or type the viewport width and height yourself.
  3. 3 On a phone, type the height of the browser bars that come and go, if you know it.
  4. 4 Read the length in pixels and in every viewport unit, and copy what you need.

Good to know

  • A full-height phone hero should use 100svh, so its bottom edge is never hidden behind the browser bars.
  • On a desktop, 100vw includes the vertical scrollbar, so width: 100vw can be wider than the page and cause sideways scrolling. Use 100% for full width instead.
  • To find the bar height on your own phone, compare an element at 100svh with one at 100lvh in the browser developer tools.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

Sizing a full-screen phone hero with vh, svh and dvh

A landing page opens with a hero that should fill the phone screen, with a button pinned to its bottom edge. The obvious CSS is height: 100vh. On a phone with a 390 × 844 viewport, that is 844 CSS pixels. The trouble is that 844 is the height with the browser bars hidden, and when the page first loads, the bars are showing. If they take 100px, only 744px of the hero is visible and the button sits behind the tool bar.

The newer units exist for exactly this. 100svh is the small viewport height, 744px in this example, so the whole hero fits when the bars show. 100lvh is the large height, 844px, the same as vh. 100dvh is dynamic: it starts at 744px and grows to 844px as the reader scrolls and the bars slide away. Set the bar height to 100 on this page and type 100dvh to see that range written out.

Which one to pick depends on the design. For a hero with a call to action at the bottom, 100svh is the safe choice, because the button is always visible. dvh looks tidier, because the hero always matches the window, but the layout shifts as the bars move, which can make text jump while someone reads. vh, now the same as lvh, suits backgrounds that may run under the bars without hiding anything important.

The same arithmetic works the other way. If a card in the design is 300px wide on a 390px phone, it is 76.92vw. On a 430px phone the same 76.92vw becomes 330.8px. That is often the reason to convert: to see whether a size that looks right on one screen still works on another. vmin and vmax help when a phone turns sideways. 50vmin is half the shorter side, 195px on a 390 × 844 phone either way round.

The calculator has limits. It does not measure your screen; it uses the numbers you pick or type. The preset sizes are the CSS viewports of common devices, and the real viewport is a little smaller where the browser shows its own interface. The height of the browser bars varies by browser, by setting and by whether the page is scrolled, so the value you type is an estimate unless you measure it. And on a desktop, the vw sums ignore the scrollbar, which takes part of the width on most Windows setups.

Frequently asked questions

How many pixels is 1vw?

One hundredth of the viewport width in CSS pixels. On a 390px wide phone, 1vw is 3.9px and 50vw is 195px. On a 1920px wide window it is 19.2px.

What is the difference between vh, svh, lvh and dvh?

They differ only where browser bars appear and disappear, which in practice means phones. svh is the height with the bars showing, lvh the height with them hidden, and dvh changes between the two as the bars move. vh matches lvh in current browsers, which is why 100vh content can sit behind the bars.

Are the screen sizes in the list real pixels?

They are CSS pixels, which is what viewport units use. An iPhone 14 has 1170 × 2532 physical pixels but a viewport of 390 × 844 CSS pixels, because each CSS pixel covers three physical ones in each direction.

Can I use svh and dvh today?

Yes. Safari supports them from 15.4, Firefox from 101 and Chrome from 108, all released in 2022.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.