Screen.height is a read-only instance property that returns the full height of the screen in CSS pixels. Learn how it differs from availHeight and innerHeight, how OS chrome shrinks available space, and the classic MDN comparison—with five examples and try-it labs.
01
Kind
Read-only property
02
Returns
Number (CSS px)
03
Access
window.screen
04
Meaning
Full screen height
05
Twin
screen.width
06
Status
Baseline widely
Fundamentals
Introduction
The browser’s screen object describes the display behind your window. screen.height answers: “How tall is the whole screen, in CSS pixels?” That is the full vertical size of the monitor (or the display associated with this window)—not how tall the current tab is.
Operating systems often keep a strip for themselves (taskbar, Dock, menu bar). That is why availHeight can be smaller than height. MDN’s classic check is: if they differ, something is occupying screen real estate.
JavaScript
console.log(window.screen.height);
💡
Beginner tip
screen.height is about the monitor. For the visible page height inside the tab, use window.innerHeight instead.
Concept
Understanding the Property
MDN: the Screen.height read-only property returns the height of the screen in CSS pixels.
Instance — on the Screen object from window.screen.
Read-only — you cannot assign to height.
CSS pixels — same unit family as layout sizes (not always hardware pixels).
Full height — may be larger than availHeight when OS chrome is reserved.
Foundation
📝 Syntax
JavaScript
const h = window.screen.height;
// same as:
const h2 = screen.height;
Value
A number: the full screen height in CSS pixels. Compare it with window.screen.availHeight when you care about space left after OS chrome.
Compare
📈 height vs availHeight
Property
Meaning
screen.height
Full screen height in CSS pixels
screen.availHeight
Height available for web content (often minus OS chrome)
screen.width
Full screen width (horizontal twin)
window.innerHeight
Viewport / layout viewport height of this window
📌
MDN note
Not all of the height from screen.height may be available to the window. Widgets such as taskbars or OS-integrated toolbars can reduce space. That difference shows up as height vs availHeight.
Practice
🎨 Detect Occupied Screen Space
MDN’s teaching example: if available height differs from full height, something is occupying screen real estate.
JavaScript
if (window.screen.availHeight !== window.screen.height) {
// Something is occupying some screen real estate!
console.log("OS chrome likely reserved vertical space");
} else {
console.log("Full height appears available");
}
Auto-hide taskbars/Docks or fullscreen mode may make the two values match even when chrome can appear later.
Cheat Sheet
⚡ Quick Reference
Goal
Code
Full screen height
screen.height
Available height
screen.availHeight
Reserved vertical px
screen.height - screen.availHeight
MDN occupied check
availHeight !== height
This tab’s height
window.innerHeight
MDN status
Baseline Widely available (Jul 2015)
Snapshot
🔍 At a Glance
Four facts about screen.height.
Kind
property
Read-only
Type
number
CSS pixels
Via
window.screen
Screen object
Status
baseline
Widely available
Hands-On
Examples Gallery
Examples follow MDN Screen.height. Numbers on your machine will differ by display and OS chrome.
📚 Getting Started
Read the full height and practice the MDN occupied-space check.
window.screen is the Screen object. height is a number you can compare with available or viewport heights.
Example 2 — MDN Occupied-Space Check
Compare full height with available height.
JavaScript
if (window.screen.availHeight !== window.screen.height) {
console.log("Something is occupying some screen real estate!");
} else {
console.log("Full height appears available");
}
Screen.height is Baseline Widely available across modern browsers (MDN: since July 2015). Logos use the shared browser-image-sprite.png sprite from this project.
✓ Baseline · Widely available
Screen.height
Full screen height in CSS pixels — often larger than availHeight when OS chrome is reserved.
UniversalWidely available
Google ChromeFull support · Desktop & Mobile
Full support
Mozilla FirefoxFull support · Desktop & Mobile
Full support
Apple SafariFull support · macOS & iOS
Full support
Microsoft EdgeFull support · Chromium
Full support
OperaFull support · Modern versions
Full support
Internet ExplorerSupported in modern IE versions
Supported
heightExcellent
Bottom line: Use screen.height for full display height; use availHeight for available vertical space; use innerHeight for this window’s viewport.
Wrap Up
Conclusion
window.screen.height is the full vertical size of the screen in CSS pixels—often a bit more than availHeight when OS chrome is always visible. Use it for display metrics and comparisons, not as a substitute for viewport height.
Expect values to differ by OS, Dock settings, and fullscreen
❌ Don’t
Assign to height (it is read-only)
Confuse it with window.innerHeight
Assume taskbars always subtract the same number of pixels
Use full screen height alone for responsive CSS layout
Ignore availHeight when planning secondary window sizes
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about height
Full screen height in CSS pixels.
5
Core concepts
🖥️01
Read-only
on Screen
Kind
📈02
CSS pixels
full screen height
Value
≥03
≥ availHeight
may include chrome
Rule
📐04
Twin
screen.width
Pair
🎯05
Baseline
widely available
Status
❓ Frequently Asked Questions
A read-only number: the full height of the screen in CSS pixels. Access it as window.screen.height.
No. MDN marks Screen.height as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
screen.height is the full screen height. availHeight is the space available for web content and is never larger—often smaller when a taskbar, Dock, or menu bar stays visible.
No. height is the monitor’s full height. innerHeight is this browser window’s viewport height and changes when you resize the tab.
No. It is read-only. You read the value; you do not assign to it.
Use screen.width for the full screen width in CSS pixels, the horizontal twin of height.
Did you know?
Multi-monitor setups still expose a single window.screen for the display associated with the window. Moving a window to another monitor can change the reported height when that display has a different resolution.