Conversion Form

VH
CM

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

Use vh for fluid height designs and cm for precise print height.

Quick Reference: Unit Conversion by Tens

VHCM
10vh2.8575cm
20vh5.715cm
30vh8.5725cm
40vh11.43cm
50vh14.2875cm
60vh17.145cm
70vh20.0025cm
80vh22.86cm
90vh25.7175cm
100vh28.575cm
110vh31.4325cm
120vh34.29cm
130vh37.1475cm
140vh40.005cm
150vh42.8625cm
160vh45.72cm
170vh48.5775cm
180vh51.435cm
190vh54.2925cm
200vh57.15cm
210vh60.0075cm
220vh62.865cm
230vh65.7225cm
240vh68.58cm
250vh71.4375cm

Live Unit Preview

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

10px

10rem

10em

10%

10vw

10vh

Common Mistake

For fluid layouts, use vh. For print layouts, use cm.

Real Code Example

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