Screen.availWidth is a read-only instance property that returns how much horizontal space (in CSS pixels) is available to the window. Learn how it differs from screen.width, how it pairs with availHeight, and how it compares to innerWidth—with five examples and try-it labs.
01
Kind
Read-only property
02
Returns
Number (CSS px)
03
Access
window.screen
04
Vs width
≤ screen.width
05
Twin
availHeight
06
Status
Baseline widely
Fundamentals
Introduction
window.screen describes the display. Full horizontal size is screen.width. availWidth is the horizontal space available to the window—often equal to width, but sometimes smaller when the OS keeps a vertical strip (for example a taskbar docked on the left or right).
This is monitor-level available width, not the width of the current tab. For the viewport inside this window, use window.innerWidth.
Concept
Understanding the Property
MDN: the Screen.availWidth property returns the amount of horizontal space (in CSS pixels) available to the window.
Instance — on the Screen object from window.screen.
Read-only — you cannot assign to availWidth.
CSS pixels — layout-oriented units, not always raw hardware pixels.
Horizontal twin — pairs with availHeight for the usable box.
Foundation
📝 Syntax
JavaScript
const w = window.screen.availWidth;
// same as:
const w2 = screen.availWidth;
Value
A number: CSS pixels of horizontal space available to the window.
Compare
📈 width vs availWidth
Property
Meaning
screen.width
Full screen width in CSS pixels
screen.availWidth
Horizontal space available to the window
screen.availHeight
Vertical space available for web content
window.innerWidth
Viewport width of this window
📌
When they differ
On many desktops with only a bottom taskbar, availWidth equals width. A vertical taskbar or other side chrome can make availWidth smaller. Always compare both if you need to know reserved space.
Cheat Sheet
⚡ Quick Reference
Goal
Code
Available width
screen.availWidth
Full screen width
screen.width
Reserved horizontal px
screen.width - screen.availWidth
Available height
screen.availHeight
This tab’s width
window.innerWidth
MDN status
Baseline Widely available (Jul 2015)
Snapshot
🔍 At a Glance
Four facts about screen.availWidth.
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.availWidth. Numbers on your machine will differ by display and OS chrome.
📚 Getting Started
Read the available width and compare it to the full screen.
Screen.availWidth 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.availWidth
CSS-pixel horizontal space available to the window — often equal to screen.width.
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
availWidthExcellent
Bottom line: Use screen.availWidth for available horizontal display space; use innerWidth for this window’s viewport; pair with availHeight for the vertical twin.
Wrap Up
Conclusion
window.screen.availWidth is the horizontal space available to the window in CSS pixels. Compare it with screen.width, pair it with availHeight, and use innerWidth when you mean this tab’s viewport.
Read screen.availWidth for available display width
Compare with screen.width to detect side chrome
Pair with availHeight for the usable screen box
Use innerWidth for layout inside the current tab
Expect values to vary by OS and taskbar position
❌ Don’t
Assign to availWidth (it is read-only)
Confuse it with window.innerWidth
Assume it always differs from screen.width
Use screen metrics alone for responsive CSS
Forget multi-monitor moves can change reported screen values
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about availWidth
Available screen width in CSS pixels.
5
Core concepts
🖥️01
Read-only
on Screen
Kind
📐02
CSS pixels
available width
Value
≤03
≤ width
may subtract chrome
Rule
📈04
Twin
availHeight
Pair
🎯05
Baseline
widely available
Status
❓ Frequently Asked Questions
A number: the amount of horizontal space in CSS pixels available to the window. Access it as window.screen.availWidth.
No. MDN marks Screen.availWidth as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
screen.width is the full screen width in CSS pixels. availWidth is the horizontal space available to the window and is often the same, but can be smaller if the OS reserves horizontal chrome (for example a vertical taskbar).
They are twins: availWidth is horizontal available space; availHeight is vertical available space. Together they describe the usable screen box for web content.
No. It is read-only. You read the value for sizing or diagnostics; you do not assign to it.
No. availWidth is about the display’s available horizontal space. innerWidth is the layout viewport width of this browser window/tab.
Did you know?
MDN documents availWidth briefly as “horizontal space available to the window,” while availHeight spells out reserved Dock/taskbar cases more. In practice, treat both as the available screen box—and always verify on the OS you care about.