Window inner and outer size
Browser window and viewport dimensions, which change constantly.
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
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 1 | 2004-11-09 | None |
| Safari | Supported | 3 | 2007-10-26 | None |
| Safari on iPhone | Supported | 1 | 2007-06-29 | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | window.innerWidth/innerHeight, outerWidth/outerHeight, visualViewport |
| Browser compat keys | api.Window.innerWidthapi.Window.outerWidth |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | read fresh on every page load; nothing stored |
| How to take it back | none needed (no grant) |
| Inside an iframe | Readable from cross-origin iframes too (same values) |
Typical flow
- Page script reads the value
- No prompt is shown
Data you get
Shape: object
How often: static per session
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
innerWidth, innerHeight | integer | CSS px | 200 to 8000 | exact; RFP buckets of 200 wide, 100 high |
outerWidth, outerHeight | integer | CSS px | about 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
| Type | Example | Apps |
|---|---|---|
| games | A browser game rescales its play field when you resize the window and keeps the aspect ratio. | None named |
| creative | A design app like Figma redraws the canvas as you drag the window. | Figma |
| video | A video call grid reshuffles the tiles when the window shrinks. | Zoom, Google Meet |
| shopping | A store changes from three columns to one when the window narrows. | None named |
| ads | An ad network sees a window of exactly 1366 by 768 and sends an ad of the right size. | None named |
| security | A fraud check sees a window with no space for browser menus, a sign of an automated headless browser. | None named |
| analytics | A 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
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 1 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3.5 | Rough identifying entropy, when known |
History
- 2020-01, Firefox: Letterboxing in resistFingerprinting rounds window size
Related capabilities
Related
- Screen width and height. Can see your screen width and height, and the usable area, in page units
Sources
How well checked: Based on official documentation.