JavaScript Screen availHeight Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Property

Definition

screen.availHeight is a read-only number: the height, in CSS pixels, of the space available for web content on the screen (MDN). Read it as window.screen.availHeight.

Read the notes below before you rely on this property. Prefer feature detection when support is limited.

Syntax

Use screen.availHeight. Start with this line.

JavaScript
window.screen.availHeight
CallWhat it does
window.screen.availHeightPrimary signature.

Built into the browser. Read screen.availHeight on window.screen — no import required.

Library declarations
JavaScript
window.screen.availHeight

Parameters

This member has no parameters beyond those shown in the signature.

Return Value

Return ValueDescription
*Number (CSS pixels)

JavaScript Examples

Example 1 — Read availHeight

Log the available screen height in CSS pixels.

JavaScript
console.log(window.screen.availHeight);
console.log(typeof screen.availHeight);
Try It Yourself

How It Works

  1. Access window.screen. Every window exposes a Screen object.
  2. Read availHeight. MDN: height in CSS pixels available for web content.
  3. Check typeof. It is always a number in browsers that support Screen.
  4. Do not write to it. The property is read-only.

Example 2 — vs height

Compare available height with full screen height and estimate reserved space.

JavaScript
const height = screen.height;
const avail = screen.availHeight;
const reserved = height - avail;

console.log(height);
console.log(avail);
console.log(avail <= height);
console.log(reserved);
Try It Yourself

How It Works

  1. Read both heights. Full vs available (MDN).
  2. Subtract. The difference approximates taskbar, Dock, or menu bar space.
  3. Assert avail <= height. Available space cannot exceed the full screen.
  4. Expect zero sometimes. Auto-hiding chrome or fullscreen may not reduce availHeight (MDN).

Example 3 — with availWidth

Report the available screen box MDN pairs with availHeight.

JavaScript
const box = {
  width: screen.availWidth,
  height: screen.availHeight
};

console.log(box.width + " x " + box.height);
console.log(box.width * box.height);
Try It Yourself

How It Works

  1. Read availWidth. Horizontal twin of availHeight (MDN).
  2. Read availHeight. Vertical available space.
  3. Print a box. Useful when opening or sizing a tool window.
  4. Optional area. Width × height is a quick size check, not a layout API.

Browser Support

Screen.availHeight is Baseline Widely available across modern browsers (MDN: since July 2015).

✓ Baseline · Widely available

Screen.availHeight

Supported in Chrome, Firefox, Safari, Edge, and Opera. Read-only CSS-pixel available height via window.screen.

Baseline Widely available
Google Chrome All versions · Desktop & Mobile
Full support
Mozilla Firefox All versions · Desktop & Mobile
Full support
Apple Safari All versions · macOS & iOS
Full support
Microsoft Edge All versions · Chromium & Legacy
Full support
Internet Explorer IE 6+ · Legacy environments
Full support
Opera All modern versions
Full support
screen.availHeight Excellent in browsers

Bottom line: Safe to read in modern browsers. See the MDN Screen.availHeight reference.

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 (MDN).
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.

Next: Screen availWidth

Learn the horizontal twin — available screen width in CSS pixels.

availWidth tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful