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…
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:
svh— small viewport. The height with every browser bar shown, as on first load.100svhalways fits on the screen.lvh— large viewport. The height with the bars retracted.100lvhis taller than the visible area while the bars show.dvh— dynamic viewport. Whatever is visible at the moment; it moves between the two as the bars slide in and out.vh— the classic unit. On phones it equalslvh, a stable value chosen so pages don't jump while scrolling. On a desktop all four are the same.
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
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
- Hero or first-screen section:
min-height: 100svh. It fits with the bars visible; when they collapse a little of the next section shows, which is harmless. Usemin-height, notheight, so the section can grow when text wraps or the reader enlarges it. - App shell, chat window, full-screen map:
100dvh, so the input bar or controls stay at the visible bottom. Expect the element to resize while the bars animate. - Background that must never show a gap:
100lvh. - Menu panel or modal: often no unit at all —
position: fixed; inset: 0;withoverflow-y: autofollows the visible area.
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
- Safari on iPhone shows the biggest difference between
svhandlvh, because its toolbar is large when a page opens and shrinks as you scroll. - Chrome on Android slides its address bar away as you scroll;
vhis the large viewport there too. Since Chrome 108 the on-screen keyboard resizes only the visual viewport, sodvhdoes not shrink when the keyboard opens unless the page setsinteractive-widget=resizes-contentin its viewport tag. - Home-screen web apps (
display: standalone) have no browser bars, so all four units are equal.
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.
| Phone | Screen (CSS px) | Bars, top + bottom (px) | ≈ 100svh |
|---|---|---|---|
| iPhone Air | 420 × 912 | 54 + 136 | 722 px |
| iPhone 16 Pro / 17 / 17 Pro | 402 × 874 | 54 + 136 | 684 px |
| iPhone 16 Pro Max / 17 Pro Max | 440 × 956 | 54 + 136 | 766 px |
| iPhone 14 Pro / 15 / 15 Pro / 16 | 393 × 852 | 54 + 136 | 662 px |
| iPhone 14 Pro Max / 15 Plus / 15 Pro Max / 16 Plus | 430 × 932 | 54 + 136 | 742 px |
| iPhone SE (2nd/3rd gen) | 375 × 667 | 20 + 88 | 559 px |
| iPhone 12 / 13 mini | 375 × 812 | 47 + 130 | 635 px |
| iPhone 12 / 13 / 14 / 16e | 390 × 844 | 47 + 130 | 667 px |
| iPhone 12 / 13 Pro Max, 14 Plus | 428 × 926 | 47 + 130 | 749 px |
| iPhone 11 Pro | 375 × 812 | 47 + 130 | 635 px |
| iPhone 11 | 414 × 896 | 47 + 130 | 719 px |
| iPhone 11 Pro Max | 414 × 896 | 47 + 130 | 719 px |
| iPhone XS | 375 × 812 | 47 + 130 | 635 px |
| iPhone XR | 414 × 896 | 47 + 130 | 719 px |
| iPhone XS Max | 414 × 896 | 47 + 130 | 719 px |
| iPhone 8 | 375 × 667 | 20 + 88 | 559 px |
| iPhone 8 Plus | 414 × 736 | 20 + 88 | 628 px |
| iPhone X | 375 × 812 | 47 + 130 | 635 px |
| iPhone 7 | 375 × 667 | 20 + 88 | 559 px |
| iPhone 7 Plus | 414 × 736 | 20 + 88 | 628 px |
| Samsung Galaxy S24 / S25 Ultra | 384 × 832 | 80 + 16 | 736 px |
| Google Pixel 9 / 9a / 10 | 412 × 924 | 80 + 16 | 828 px |
| Google Pixel 9 Pro | 427 × 952 | 80 + 16 | 856 px |
| Samsung Galaxy A15 / A54 / A55 | 384 × 832 | 80 + 16 | 736 px |
| Galaxy Z Flip 5 / 6 | 360 × 880 | 80 + 16 | 784 px |
| Galaxy Z Fold 5 (folded) | 344 × 882 | 80 + 16 | 786 px |
| Xiaomi 14 / 15 | 400 × 890 | 80 + 16 | 794 px |
| OnePlus 11 | 412 × 919 | 80 + 16 | 823 px |
| Samsung Galaxy S22 / S23 / S24 / S25 | 360 × 780 | 80 + 16 | 684 px |
| Xiaomi Redmi Note 11 / 12 / 13 | 393 × 873 | 80 + 16 | 777 px |
| Xiaomi 13 | 393 × 873 | 80 + 16 | 777 px |
| Google Pixel 6 / 7 / 8 | 412 × 915 | 80 + 16 | 819 px |
| Samsung Galaxy S20 / S21 | 360 × 800 | 80 + 16 | 704 px |
| Google Pixel 4a / 5 | 393 × 851 | 80 + 16 | 755 px |
| Samsung Galaxy S10 | 360 × 760 | 80 + 16 | 664 px |
| Huawei P30 / P40 | 360 × 780 | 80 + 16 | 684 px |
| Xiaomi Redmi Note 8 / 9 | 393 × 851 | 80 + 16 | 755 px |
| Samsung Galaxy A51 / A71 | 412 × 915 | 80 + 16 | 819 px |
| Google Pixel 3 | 393 × 786 | 80 + 48 | 658 px |
| Google Pixel 2 | 412 × 732 | 80 + 48 | 604 px |
| Samsung Galaxy S8 / S9 | 360 × 740 | 80 + 48 | 612 px |
| Samsung Galaxy S7 | 360 × 640 | 80 + 48 | 512 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