Screen metrics.width / availWidth describe the display.
Window metric.innerWidth is the layout viewport of this tab.
Resize the browser. Only innerWidth changes; screen values stay put.
Rule of thumb. Layout → innerWidth; display size → screen.width.
Compatibility
Browser Support
Screen.width is Baseline Widely available (MDN: since July 2015). It works in all modern desktop and mobile browsers.
✓ Baseline · Widely available
Screen.width
Full screen width in CSS pixels — supported everywhere you teach modern JavaScript.
98%Widely available
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
screen.widthExcellent
Bottom line: Safe for production. Use width for full display width; availWidth for usable horizontal space; innerWidth for this window’s viewport.
Frequently Asked Questions
A read-only number: the full width of the screen in CSS pixels. Access it as window.screen.width or screen.width.
No. MDN marks it as Baseline Widely available (since July 2015). It is not Deprecated, Experimental, or Non-standard.
screen.width is the full screen width. availWidth is the space available for web content and is never larger—often smaller when OS chrome reserves horizontal space.
No. width is the monitor’s full width. innerWidth is this browser window’s viewport width and changes when you resize the tab.
No. It is read-only. You read the value; assigning to it has no effect for web content sizing.
Use screen.height for the full screen height in CSS pixels—the vertical twin of width.