Inputs
Pixels960
Ready
Fifty viewport-width units on a 1920px-wide screen are 960px. The formula is the unit value divided by 100, times the matching screen edge. vw uses the width. vh uses the height. vmin uses the shorter edge. vmax uses the longer edge. On a 1920 by 1080 screen the shorter edge is 1080, so 50vmin is 540px, while 50vmax is still 960px.
The page needs the screen you care about, because a phone and a desktop share the same vw number and not the same pixel count. 100vw is the full width you typed. 1vw is one hundredth of it. There is no separate control that turns pixels back into vw: divide the pixels by the width and multiply by 100.
vmin and vmax are the ones that surprise people in a square layout. If the width and height are equal, all four units agree. The moment the screen is wider than it is tall, vw and vmax stay together and vh and vmin stay together. A portrait phone reverses that pairing.
Width 1920. Height 1080. Viewport units 50. Unit vw.
960 pixels. That is 50 percent of the width. The same 50 as vh would be 540, half of 1080.
Oddsock runs this in your browser. It is free, it does not upload the work, and it does not ask for an account.
One hundredth of the width you entered. On a 1920px width, 1vw is 19.2px and 50vw is 960px.
vmin is a percent of the shorter side. vmax is a percent of the longer side. On 1920 by 1080, 50vmin is 540 and 50vmax is 960.
Divide the pixels by the width and multiply by 100. 960 / 1920 × 100 is 50vw. The page itself reports pixels from a unit value.
It uses the width and height you type. If a scrollbar eats 15px of the layout viewport, subtract that from the width before you convert.
The classic vh unit uses the large viewport, which can sit behind browser chrome. This page converts the height you type, so use the visible height if that is the one you are designing for.