VH TO PX Converter
VH
Viewport Height
What is Vh to Px Converter?
Px stands for pixels, and Vh stands for Viewport height. Vh is a CSS unit that sizes elements relative to the browser window’s height. On the other hand, pixels are fixed units. This Viewport height to pixels converter is a free online tool to help you convert Vh values into pixels.
How do you use a Viewport height to pixels tool?
Follow the steps below so that you can convert the viewport height value into pixels:
Step 1: Enter the Vh value that you want to convert.
Step 2: Now set the viewport height(vh) to 900(for instance), in which you want to convert the vh value.
Step 3: Press the convert button and get the results in pixels.
What is Viewport Height (VH)?

As discussed in the previous article(px to vh converter), the viewport is the visible area of a webpage in your browser’s window. Viewport height is a CSS unit representing a percentage of this viewport’s height.
How do you compute the viewport height (VH) to pixels (PX)?
Now you know that Vh is a percentage-based unit, and px is fixed. So, to convert the viewport height into pixels, you must see the viewport height in pixels. Moreover, this value varies based on the user’s device.
VH to PX Formula:
Pixel Value (px) = ( Viewport Height in Pixels / 100 ) * VH Value
Check our other pixels converter tool px to vh to do other conversions.
Viewport height to pixels Conversion Table
The following table shows the common VH values that translate into pixels on different devices with varying viewports. Moreover, these equivalents may ease your findings by directly getting the exact values.
VH | iPhone 12 Pro (844px) | iPad Pro 12 Pro (1366px) | Samsung Galaxy S9+ (740px) |
---|---|---|---|
5.9vh | 50px | 81px | 44px |
7.1vh | 60px | 97px | 52px |
8.9vh | 75px | 121px | 66px |
10.6vh | 90px | 146px | 78px |
11.8vh | 100px | 163px | 87px |
14.2vh | 120px | 195px | 104px |
17.7vh | 150px | 244px | 130px |
19.0vh | 160px | 260px | 141px |
21.3vh | 180px | 293px | 158px |
23.6vh | 200px | 326px | 175px |
26.1vh | 220px | 358px | 192px |
29.6vh | 250px | 407px | 219px |
33.1vh | 280px | 456px | 246px |
35.5vh | 300px | 489px | 263px |
41.5vh | 350px | 568px | 306px |
47.3vh | 400px | 650px | 350px |
53.2vh | 450px | 732px | 394px |
59.1vh | 500px | 813px | 437px |
65vh | 550px | 895px | 481px |
71vh | 600px | 977px | 525px |
82.9vh | 700px | 1135px | 612px |
94.6vh | 800px | 1293px | 699px |
106.3vh | 900px | 1451px | 786px |
118.1vh | 1000px | 1609px | 873px |
Uses of Viewport height to pixels converter
Here are some everyday use cases of Viewport height to pixels converter that help you in designing a website and also for its development:
- JavaScript calculations
- Pixel-perfect adjustments
- Cross-device rendering
- Mental model and debugging
You can also do c paper sizes to pixels on our website.
Few Important Examples of Vh
Below are few of the important and best examples of vh use in web designing and development:
Example 1: Creating a Full-Screen Hero Section
Scenario: You want a hero section to always fill the entire height of the browser window, regardless of the content within it.
CSS:
.hero {
height: 100vh; /* Takes up 100% of the viewport height */
background-image: url("hero-image.jpg");
background-size: cover;
display: flex; /* For centering content */
align-items: center;
justify-content: center;
color: white;
}
Explanation: 100vh ensures that the .hero element always occupies the full viewport height. Even if the content inside the hero section is shorter than the viewport, the hero section will stretch to fill the screen. This is a common technique for creating visually impactful hero sections.
Example 2: Creating a Sticky Footer
Scenario: You want a footer to always stick to the bottom of the viewport, even if the content on the page is short.
CSS:
body {
display: flex;
flex-direction: column;
min-height: 100vh; /* Ensure body takes full viewport height */
}
main { /* Or your main content area */
flex: 1; /* Allows main content to expand and fill available space */
}
footer {
height: 50px; /* Fixed height for the footer */
background-color: #333;
color: white;
text-align: center;
padding: 10px;
}
Explanation: This layout technique uses flexbox to achieve the sticky footer effect.
- display: flex and flex-direction: column on the body make it a flex container with a vertical layout.
- min-height: 100vh on the body ensures that the body element always takes up the full viewport height.
- flex: 1 on the main content area allows it to expand and fill the available space between the header (if you have one) and the footer.
- The footer has a fixed height.
Because the body is at least 100vh, the footer will always be at the bottom of the viewport. If the content is longer than the viewport, the footer will simply flow below the content as usual.