Dark Mode Off / On

Disclosure: This post contains affiliate links, which means we may earn a commission if you purchase through our links at no extra cost to you.

100 vh equals the total height of the viewport in pixels. For example, if your browser window is 900 pixels tall, then 100 vh is 900 px.

This happens because vh units represent a percentage of the viewport height, so 100 vh means 100 percent of the visible height, converted directly to pixels depending on the screen size.

Conversion Tool


Result in px:

Conversion Formula

The formula to convert vh to px is:

pixels = (vh_value * viewport_height) / 100

The vh unit is a percentage of the viewport height. So, if the viewport height is 800 pixels, 1 vh equals 8 pixels (800 / 100).

Using this, you multiply the vh value by the viewport height then divide by 100 to get the pixel equivalent.

Example: Convert 50 vh to pixels, if viewport height is 900 px.

  • Calculate 1 vh: 900 / 100 = 9 px
  • Multiply by 50: 50 * 9 = 450 px
  • So, 50 vh equals 450 pixels

Conversion Example

  • Example 1: 75 vh
    • Viewport height: 1000 px
    • 1 vh = 1000 / 100 = 10 px
    • 75 vh = 75 * 10 = 750 px
  • Example 2: 120 vh
    • Viewport height: 850 px
    • 1 vh = 850 / 100 = 8.5 px
    • 120 vh = 120 * 8.5 = 1020 px
  • Example 3: 90 vh
    • Viewport height: 720 px
    • 1 vh = 720 / 100 = 7.2 px
    • 90 vh = 90 * 7.2 = 648 px
  • Example 4: 110 vh
    • Viewport height: 950 px
    • 1 vh = 950 / 100 = 9.5 px
    • 110 vh = 110 * 9.5 = 1045 px

Conversion Chart

This chart shows vh values from 75.0 to 125.0 and their pixel equivalents for a viewport height of 900 pixels. To use the chart, find the vh value and read the corresponding pixels value.

vhPixels (px)
75.0675.0
80.0720.0
85.0765.0
90.0810.0
95.0855.0
100.0900.0
105.0945.0
110.0990.0
115.01035.0
120.01080.0
125.01125.0

Related Conversion Questions

  • How many pixels is 100 vh on a 1080p screen?
  • What does 100 vh equal in px when viewport height changes?
  • Why does 100 vh sometimes not equal 100% height in pixels?
  • How to calculate 100 vh to pixels for mobile devices?
  • Is 100 vh the same as window.innerHeight in pixels?
  • What is the pixel value of 100 vh when browser toolbar is visible?
  • Does 100 vh change when browser window is resized?

Conversion Definitions

vh: A CSS unit representing 1% of the viewport height. The viewport height is the visible area of a web page on the screen, excluding browser interface elements. Using vh allows elements to scale relative to the window height, adjusting dynamically when the window size changes.

px: The pixel is a unit of measurement in digital imaging and displays. It represents a single point on the screen, its size depending on the device’s resolution and pixel density. Pixels are absolute units used to specify fixed dimensions in CSS or graphics.

Conversion FAQs

Does 100 vh always equal the full height of the screen in pixels?

Not always. 100 vh represents 100 percent of the viewport height, which excludes browser UI like toolbars or address bars. On some devices or browsers, these UI elements reduce the viewport height, so 100 vh matches only the visible area, not the entire screen height.

Can 100 vh value change when I scroll the page?

Yes, in some mobile browsers, the viewport height changes while scrolling because UI elements hide or appear. This means 100 vh recalculates dynamically, affecting layout size. Desktop browsers usually keep viewport height fixed, so 100 vh stays constant on scroll.

Why do layouts using 100 vh sometimes overflow the screen?

This happens because some browsers include or exclude certain UI parts differently when calculating viewport height. If CSS elements use 100 vh plus margins or padding, the total height may exceed the visible area, causing overflow. Testing on multiple devices helps avoid this.

Is window.innerHeight equal to 100 vh in pixels?

Close but not always identical. window.innerHeight returns the interior height of the window in pixels, including the viewport but sometimes excluding certain UI elements. 100 vh corresponds to the viewport height in CSS, which may differ slightly depending on browser behavior or zoom levels.

How to ensure consistent pixel value from vh units across browsers?

Because viewport units can behave slightly different across browsers, combining vh units with JavaScript measurements like window.innerHeight helps. You can update element sizes dynamically by listening to resize events and adjusting CSS or inline styles to maintain consistent pixel sizing.

Avatar photo

Mia Vortex

She is the founder of DJ Planet, bringing expert insights into the world of DJing and music mixing. With a deep understanding of DJ systems, tools, and product recommendations, she shares valuable knowledge to help both beginners and professionals elevate their craft.

Beyond the decks, she also has a passion for gardening, blending the rhythmic beats of DJing with the serenity of nature. Whether it's curating the perfect DJ setup or cultivating a thriving garden, she delivers expertise in both worlds.