Detect Monitor Size

Optimize your layout. This script distinguishes between the physical screen resolution and the actual "usable" workspace available to applications.

Your Usable Workspace
Available Width ...
Available Height ...

This accounts for your taskbar/dock.

Copy the Script

<script>
document.write("Available Width: " + screen.availWidth + "px<br>");
document.write("Available Height: " + screen.availHeight + "px");
</script>

Frequently Asked Questions

`screen.width` gives the total resolution (e.g., 1920px). `screen.availWidth` gives the usable space (e.g., 1920px minus the width of a side taskbar).

Yes. You can use `window.resizeTo(screen.availWidth, screen.availHeight)` to maximize a popup window to fill the available space.

It generally reports the dimensions of the monitor where the browser window is currently located.