MobileCheck

Viewport Units Visualizer: vh vs svh, lvh and dvh

This page measures 100vh, 100svh, 100lvh and 100dvh live in your browser — open it on a phone and scroll to watch them change — and writes the CSS that keeps a full-height section clear of the mobile toolbar.

Your browser right now

Viewport: measuring…

  • 100svh Small viewport: all browser bars shown —
  • 100dvh Dynamic viewport: what is visible right now —
  • 100lvh Large viewport: bars retracted —
  • 100vh Classic vh: the large viewport on phones —

The measurement runs in your browser with JavaScript: it sizes four hidden elements with 100vh, 100svh, 100lvh and 100dvh and reads their height.

On a phone, scroll down and up: as the toolbar collapses, the 100dvh bar grows from the 100svh value toward 100lvh, and the numbers update.

CSS for a full-height section

.hero {
  min-height: 100vh;  /* fallback: browsers without svh ignore the next line */
  min-height: 100svh; /* fits with the browser bars shown */
}

What the four numbers mean

CSS Values and Units Level 4 defines three viewport sizes, because a phone browser's own toolbars come and go while you scroll:

There are matching width units (svw, lvw, dvw), but on phones the toolbars change the height, not the width. The tool above measures the four heights by giving hidden, fixed-position elements a height of 100vh, 100svh, 100lvh and 100dvh and reading their size after each resize and scroll.

The classic bug: a 100vh hero behind Safari's toolbar

Left: a hero set to 100vh is as tall as the screen with the toolbar retracted, so on first load its bottom, with the button, sits under the toolbar. Right: with 100svh the hero ends above the toolbar.

Safari on iPhone shows its toolbar when a page opens and collapses it once you scroll. Because 100vh is measured with the toolbar collapsed, a 100vh hero is taller than what the visitor sees on arrival, and whatever sits at its bottom — usually the call to action — is hidden until they scroll. Chrome on Android does the same with its address bar, with a smaller gap. The fix is one extra line: keep 100vh as a fallback and add 100svh after it, as the generator above writes. Browsers that don't know svh drop that line and keep the first one.

Which unit for which job

Old workarounds — -webkit-fill-available, or a --vh custom property set from window.innerHeight in JavaScript — are no longer needed and can fight the new units, so remove them when you switch. The 100vh on mobile guide covers each case with examples.

Browser support

The small, large and dynamic units work in Safari 15.4 and later, Chrome 108 and later and Firefox 101 and later (web.dev, MDN). iPhones that cannot update past iOS 15.3 or earlier don't understand them, which is what the 100vh fallback line is for. If this tool says your browser does not support them, you are looking at one of those older browsers.

On iPhone vs Android

Visible height on load, by phone

Estimated 100svh for the phones in our catalog: the screen height in CSS pixels minus the browser bars as our device profiles model them (status bar and address bar at the top, toolbar or navigation at the bottom). These are our profiles' estimates, not measurements from each phone — the bars differ between browser versions and settings. 100vh and 100lvh are larger by however much of the bars retracts when you scroll.

PhoneScreen (CSS px)Bars, top + bottom (px)≈ 100svh
iPhone Air420 × 91254 + 136722 px
iPhone 16 Pro / 17 / 17 Pro402 × 87454 + 136684 px
iPhone 16 Pro Max / 17 Pro Max440 × 95654 + 136766 px
iPhone 14 Pro / 15 / 15 Pro / 16393 × 85254 + 136662 px
iPhone 14 Pro Max / 15 Plus / 15 Pro Max / 16 Plus430 × 93254 + 136742 px
iPhone SE (2nd/3rd gen)375 × 66720 + 88559 px
iPhone 12 / 13 mini375 × 81247 + 130635 px
iPhone 12 / 13 / 14 / 16e390 × 84447 + 130667 px
iPhone 12 / 13 Pro Max, 14 Plus428 × 92647 + 130749 px
iPhone 11 Pro375 × 81247 + 130635 px
iPhone 11414 × 89647 + 130719 px
iPhone 11 Pro Max414 × 89647 + 130719 px
iPhone XS375 × 81247 + 130635 px
iPhone XR414 × 89647 + 130719 px
iPhone XS Max414 × 89647 + 130719 px
iPhone 8375 × 66720 + 88559 px
iPhone 8 Plus414 × 73620 + 88628 px
iPhone X375 × 81247 + 130635 px
iPhone 7375 × 66720 + 88559 px
iPhone 7 Plus414 × 73620 + 88628 px
Samsung Galaxy S24 / S25 Ultra384 × 83280 + 16736 px
Google Pixel 9 / 9a / 10412 × 92480 + 16828 px
Google Pixel 9 Pro427 × 95280 + 16856 px
Samsung Galaxy A15 / A54 / A55384 × 83280 + 16736 px
Galaxy Z Flip 5 / 6360 × 88080 + 16784 px
Galaxy Z Fold 5 (folded)344 × 88280 + 16786 px
Xiaomi 14 / 15400 × 89080 + 16794 px
OnePlus 11412 × 91980 + 16823 px
Samsung Galaxy S22 / S23 / S24 / S25360 × 78080 + 16684 px
Xiaomi Redmi Note 11 / 12 / 13393 × 87380 + 16777 px
Xiaomi 13393 × 87380 + 16777 px
Google Pixel 6 / 7 / 8412 × 91580 + 16819 px
Samsung Galaxy S20 / S21360 × 80080 + 16704 px
Google Pixel 4a / 5393 × 85180 + 16755 px
Samsung Galaxy S10360 × 76080 + 16664 px
Huawei P30 / P40360 × 78080 + 16684 px
Xiaomi Redmi Note 8 / 9393 × 85180 + 16755 px
Samsung Galaxy A51 / A71412 × 91580 + 16819 px
Google Pixel 3393 × 78680 + 48658 px
Google Pixel 2412 × 73280 + 48604 px
Samsung Galaxy S8 / S9360 × 74080 + 48612 px
Samsung Galaxy S7360 × 64080 + 48512 px

MobileCheck's free check uses the same profiles: each device's viewport is its screen minus these bars. Our emulated browsers have no toolbar that collapses, so in a report vh, svh, lvh and dvh all resolve to the visible height. To see the units differ, open this page on a real phone. The mobile viewport sizes list has the full screen sizes, and the safe area preview covers the notch and home indicator.

Frequently asked questions

What is the difference between vh, svh, lvh and dvh?

svh is 1% of the viewport with all browser bars shown, lvh 1% of the viewport with the bars retracted, and dvh 1% of whatever is visible at the moment. On phones, vh means the same as lvh, which is why a 100vh section can be taller than the visible screen.

Why do all four units show the same number on my computer?

Desktop browsers have no toolbar that collapses while you scroll, so the small, large and dynamic viewports are the same size. Open this page on a phone in Safari or Chrome to see them differ.

Should I replace every 100vh with 100dvh?

No. dvh changes while the toolbars move, so elements sized with it resize during scrolling. Use svh for heroes and sections that must fit on the first screen, and keep dvh for app-like layouts that must always match the visible area.

Does the on-screen keyboard change dvh?

Not by default. On iPhone and in Chrome on Android since version 108 the keyboard shrinks only the visual viewport, so the viewport units stay the same. Read window.visualViewport.height to place something above the keyboard.

More free tools: color contrast checker · tap target size checker · mobile font size calculator · css media query generator · device mockup generator · safe area inset preview · responsive image srcset generator · link preview checker · ai crawler access checker · image alt text checker · all tools