Conversion Form

VH
PX

About the Unit

VH (Viewport Height): Like VW, VH is a relative unit, but instead of being based on the viewport width, it is based on the height of the viewport. 1vh represents 1% of the viewport height, meaning that if the viewport height is 1000px, 1vh will be equal to 10px. The vh unit is widely used when you want elements to occupy a percentage of the screen height, making the design more adaptable to different device sizes. A common use case is to create 'hero sections' or headers that occupy the full height of the screen. For example, if you set an element’s height to 100vh, it will occupy 100% of the viewport height, ensuring that the content automatically adjusts to the screen height of the device, regardless of its resolution. This unit is also useful for scroll layouts on long pages, where the height of elements is crucial for navigation.

Pro Tip: vhpx

1vh = 1% of the viewport height. Useful for full-height sections.

Quick Reference: Unit Conversion by Tens

VHPX
10vh108px
20vh216px
30vh324px
40vh432px
50vh540px
60vh648px
70vh756px
80vh864px
90vh972px
100vh1080px
110vh1188px
120vh1296px
130vh1404px
140vh1512px
150vh1620px
160vh1728px
170vh1836px
180vh1944px
190vh2052px
200vh2160px
210vh2268px
220vh2376px
230vh2484px
240vh2592px
250vh2700px

Live Unit Preview

See how different CSS units affect the size of the box below:

10px

10rem

10em

10%

10vw

10vh

Common Mistake

1vh = 1% of the viewport height. Useful for full-height sections.

Real Code Example

/* Mobile-first card with vh → px */
.card {
  padding: 0vh;     /* undefinedpx */
  font-size: 1.5rem;
  width: min(90vw, 40ch);
}

Frequently Asked Questions About VH

When should I use vh instead of vh?

Use vh for vertical scaling and full-height sections.

How many vh is 1vh?

1vh = 1% of the viewport height.

Is vh affected by screen size?

Yes, it changes with browser height.

Is vh good for hero sections?

Yes, it's perfect for full-screen components.

Keyboard Shortcuts

  • Ctrl + C: Convert
  • Ctrl + I: Invert units
  • Esc: Reset values

More popular conversions