Skip to Content
Platform.Ontology

Window inner and outer size

Browser window and viewport dimensions, which change constantly.

Gets silentlyScreen and windowsWindowWeb browsersWhen the page loadsWhile you use it

In one line

Can see your browser window and visible page size, as they change

Browser window and viewport dimensions, which change constantly.

Reveals tiling, maximized vs windowed use, sidebars and devtools. Firefox RFP rounds inner size to 200x100 steps (letterboxing) so everyone shares a few buckets.

What it can and can't do

What the user does: Nothing. It happens when the page loads.

It can

  • Check the window's inner and outer size
  • Notice when you resize or rotate
  • Choose a layout that fits

It cannot

  • See your screen contents or other windows
  • See which monitor the window is on
  • Resize your window

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported122015-07-29None
FirefoxSupported12004-11-09None
SafariSupported32007-10-26None
Safari on iPhoneSupported12007-06-29None
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIwindow.innerWidth/innerHeight, outerWidth/outerHeight, visualViewport
Browser compat keysapi.Window.innerWidth
api.Window.outerWidth
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsread fresh on every page load; nothing stored
How to take it backnone needed (no grant)
Inside an iframeReadable from cross-origin iframes too (same values)

Typical flow

  1. Page script reads the value
  2. No prompt is shown

Data you get

Shape: object
How often: static per session

FieldTypeUnitRangePrecision
innerWidth, innerHeightintegerCSS px200 to 8000exact; RFP buckets of 200 wide, 100 high
outerWidth, outerHeightintegerCSS pxabout inner plus chrome (about 80 to 140 px high)Not listed

Technical limits

  • Not the same as screen size

The story

What it is

The size of your browser window and visible page area, which change all the time.

For you

You never see it read. It is why a page reflows when you drag the window narrower, and why a phone gets the mobile layout.

For makers

This is the base of responsive design. Makers also log window sizes to learn real use. Trackers use odd sizes too, since each person resizes their window a bit differently.

Where you see it

TypeExampleApps
gamesA browser game rescales its play field when you resize the window and keeps the aspect ratio.None named
creativeA design app like Figma redraws the canvas as you drag the window.Figma
videoA video call grid reshuffles the tiles when the window shrinks.Zoom, Google Meet
shoppingA store changes from three columns to one when the window narrows.None named
adsAn ad network sees a window of exactly 1366 by 768 and sends an ad of the right size.None named
securityA fraud check sees a window with no space for browser menus, a sign of an automated headless browser.None named
analyticsA site team learns the real window size, not just the monitor size, to find where designs break.None named

Risks

  • Fingerprint clue
  • Reveals browser setup

What the platform says

  • MDN: Window.innerWidth. Documents how a page reads the width of the visible page area, used for responsive design.

Good uses and abuse

Legitimate uses

  • Layout

Known abuse

  • Session linking with high-entropy size

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits3.5Rough identifying entropy, when known

History

  • 2020-01, Firefox: Letterboxing in resistFingerprinting rounds window size

Sources

How well checked: Based on official documentation.

On this page