Conversion Form

VH
VW

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: vhvw

Use vh for height-related sizing and vw for width-related layout sizing.

Quick Reference: Unit Conversion by Tens

VHVW
10vh5.625vw
20vh11.25vw
30vh16.875vw
40vh22.5vw
50vh28.125vw
60vh33.75vw
70vh39.375vw
80vh45vw
90vh50.625vw
100vh56.25vw
110vh61.875vw
120vh67.5vw
130vh73.125vw
140vh78.75vw
150vh84.375vw
160vh90vw
170vh95.625vw
180vh101.25vw
190vh106.875vw
200vh112.5vw
210vh118.125vw
220vh123.75vw
230vh129.375vw
240vh135vw
250vh140.625vw

Live Unit Preview

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

10px

10rem

10em

10%

10vw

10vh

Common Mistake

Use vh for full-height sections, vw for width-based layouts.

Real Code Example

/* Mobile-first card with vh → vw */
.card {
  padding: 0vh;     /* undefinedvw */
  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