Screen.availHeight is a read-only instance property that returns how tall (in CSS pixels) the space available for web content is on the screen. Learn how it differs from screen.height, why taskbars and Docks matter, and how it pairs with availWidth—with five examples and try-it labs.
01
Kind
Read-only property
02
Returns
Number (CSS px)
03
Access
window.screen
04
Vs height
≤ screen.height
05
Twin
availWidth
06
Status
Baseline widely
Fundamentals
Introduction
Every browser window has a screen object describing the display. The full screen height is screen.height. But operating systems often keep a strip for themselves—Windows taskbar, macOS menu bar and Dock, and similar chrome.
availHeight answers: “How many CSS pixels of vertical space can web content reasonably use?” You read it as window.screen.availHeight.
JavaScript
console.log(window.screen.availHeight);
💡
Beginner tip
This is about the monitor’s available area, not the current browser viewport. For the visible page height inside the tab, use window.innerHeight instead.
Concept
Understanding the Property
MDN: the read-only Screen interface’s availHeight property returns the height, in CSS pixels, of the space available for web content on the screen.
Instance — on the Screen object from window.screen.
Read-only — you cannot assign to availHeight.
CSS pixels — same unit family as layout sizes (not always hardware pixels).
Reserved chrome — may be less than screen.height when UI is always shown.
Foundation
📝 Syntax
JavaScript
const h = window.screen.availHeight;
// same as:
const h2 = screen.availHeight;
Value
A number: CSS pixels of available vertical space. It can be no larger than window.screen.height, and will be less if the device or user agent reserves vertical space for itself.
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.availWidth
Width available for web content (horizontal twin)
window.innerHeight
Viewport / layout viewport height of this window
📌
Dock / taskbar tip (MDN)
On a Mac with the Dock at the bottom, availHeight is roughly height minus Dock and menu bar—when those stay visible. Auto-hide Dock or fullscreen mode may mean they are not subtracted.
Practice
🎨 Sizing Secondary Windows
MDN’s classic use case: open a tool palette and stretch it to the full available vertical space. The idea looks like this (popup blockers and browser policies may limit real resizing in some environments):
JavaScript
// Main window: open a small palette
const paletteWindow = window.open(
"panels.html",
"Panels",
"left=0, top=0, width=200"
);
// Inside panels.html (after open), MDN-style idea:
// window.outerHeight = window.screen.availHeight;
Prefer reading availHeight for planning sizes. Assigning outerHeight is restricted in many modern browsers unless the script opened the window itself and policies allow it.
Cheat Sheet
⚡ Quick Reference
Goal
Code
Available height
screen.availHeight
Full screen height
screen.height
Reserved vertical px
screen.height - screen.availHeight
Available width
screen.availWidth
This tab’s height
window.innerHeight
MDN status
Baseline Widely available (Jul 2015)
Snapshot
🔍 At a Glance
Four facts about screen.availHeight.
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.availHeight. Numbers on your machine will differ by display and OS chrome.
📚 Getting Started
Read the available height and compare it to the full screen.
innerHeight / outerHeight describe this window. availHeight describes available space on the display. Resize the browser and only the window values change.
Applications
🚀 Common Use Cases
Planning max height for a secondary tool window or palette.
Logging display metrics in diagnostics or QA tools.
Estimating how much vertical OS chrome is reserved.
Teaching screen metrics vs viewport metrics to beginners.
Pairing with availWidth for available screen area.
Under the Hood
🔧 How It Works
1
OS reports the display
Full size plus which chrome stays always visible.
OS
2
Browser builds Screen
Exposes height, availHeight, width, availWidth, and more.
Screen
3
You read availHeight
Gets CSS-pixel available vertical space.
Read
4
✓
Use for sizing hints
Especially for secondary windows—not for CSS layout alone.
Important
📝 Notes
Baseline Widely available (MDN, since July 2015).
Not Deprecated, Experimental, or Non-standard — no status banner required.
Read-only — do not assign to availHeight.
Not the same as window.innerHeight (viewport of this window).
Screen.availHeight 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.availHeight
CSS-pixel height available for web content on the screen — often less than screen.height.
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
availHeightExcellent
Bottom line: Use screen.availHeight for available vertical display space; use innerHeight for this window’s viewport; pair with availWidth for the horizontal twin.
Wrap Up
Conclusion
window.screen.availHeight is the available vertical space for web content in CSS pixels—often a bit less than screen.height when OS chrome is always visible. Use it for display metrics and secondary-window planning, not as a substitute for viewport height.
Read screen.availHeight for available display height
Compare with screen.height to see reserved chrome
Pair with availWidth for the usable screen box
Use innerHeight for layout inside the current tab
Expect values to differ by OS, Dock settings, and fullscreen
❌ Don’t
Assign to availHeight (it is read-only)
Confuse it with window.innerHeight
Assume taskbars always subtract the same number of pixels
Rely on setting outerHeight in every browser without checks
Use screen metrics alone for responsive CSS (prefer media queries / container queries)
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about availHeight
Available screen height in CSS pixels.
5
Core concepts
🖥️01
Read-only
on Screen
Kind
📈02
CSS pixels
available height
Value
≤03
≤ height
may subtract chrome
Rule
📐04
Twin
availWidth
Pair
🎯05
Baseline
widely available
Status
❓ Frequently Asked Questions
A read-only number: the height in CSS pixels of the space available for web content on the screen. Access it as window.screen.availHeight.
No. MDN marks Screen.availHeight as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
screen.height is the full screen height in CSS pixels. availHeight is never larger and is often smaller when the OS or browser reserves vertical space (taskbar, Dock, menu bar).
MDN: Dock and menu bar only reduce availHeight when they are always shown. If the Dock auto-hides, or the page is fullscreen, they may not be counted.
No. It is read-only. You read the value to size or position windows; you do not assign to it.
Use screen.availWidth for the CSS-pixel width available to the browser, the horizontal twin of availHeight.
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 screen metrics when focus follows that display.