# outerHeight vs innerHeight: the chrome a page can measure

> innerHeight is the page's viewport, outerHeight the whole window. Subtract one from the other and a page has the height of your tabs and toolbar.

Source: https://mosaicbrowser.com/blog/outer-minus-inner-height

## outerHeight minus innerHeight is the browser chrome a page can measure

innerHeight is the page's viewport, outerHeight the whole window. Subtract one from the other and a page has the height of your tabs and toolbar.

![6: Six numbers that describe one window](https://mosaicbrowser.com/covers/outer-minus-inner-height.webp)

`innerHeight` is the height of the viewport, the area the page is drawn in. `outerHeight` is the height of the whole browser window. So `outerHeight - innerHeight` is the browser's own interface: the tab strip, the address bar and the bookmarks bar if it is showing. Any page can do that subtraction, and its answer depends on which browser is drawing the window and on which operating system.

## outerHeight vs innerHeight in the spec

The CSSOM View draft defines both. `innerWidth` and `innerHeight` "must return the viewport width" and height "including the size of a rendered scroll bar (if any)". `outerWidth` and `outerHeight` "must return the width" and height "of the client window", which is the window itself. `screenX` and `screenY` give the position of that window's left and top edges, in CSS pixels, from the origin of the screen area the page can see.

That gives a page six numbers, and the widths behave a little differently from the heights. `outerWidth - innerWidth` is usually small: window borders, or nothing on a Mac. It grows when something is docked beside the page, such as an open DevTools pane, because that space comes out of the viewport and not out of the window.

The scroll bar is a seventh number hiding in there. `document.documentElement.clientWidth` leaves the scroll bar out, while `innerWidth` includes it, so the gap between them is the scroll bar's width. That width is set by the operating system and by one of its settings, and it was a value our profiles used to inherit from this Mac: 15 pixels on two profiles that shared nothing else.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Machines that exist](https://mosaicbrowser.com/features/real-fingerprints)

## Why the six window values are a set

One change in our engine can claim all six. Its notes say what we learned while writing it: they are "a set rather than six independent values". A page that reads `innerWidth`, `outerWidth` and `screenX` together can check that the window fits on the claimed screen and that the chrome height is plausible for the claimed OS. Spoofing one value and inheriting the others "describes no real window".

Each check is a line of script:

- `screenX + outerWidth` against `screen.width`. A window hanging far off the right edge of a laptop screen is odd.
- `screenY` against `screen.availTop`. On a Mac we claim 25 for the menu bar, and a window above that line is one no Mac draws ([screen.availTop](https://mosaicbrowser.com/blog/screen-availtop-menu-bar) has why that number alone names a platform).
- `outerHeight - innerHeight` against the browser and OS in the User-Agent.
- `innerWidth` against every other way a page measures width: media queries, a `100vw` element, plain layout.

That last one is why the change exists and is switched off. The `--fingerprint-window-*` switches are built and we never send them. The comment beside the launcher's switch list says it plainly: emitting them "would make `innerWidth` disagree with what a page measures by rendering a full-width element". A claim only JavaScript can see is a contradiction, because the page has other ways to measure the same thing.

## What Mosaic sends instead

We size the real window. A desktop profile opens with `--window-size` at 1280 by 800, or smaller if the profile's own available screen is smaller. Then the engine lays out a real viewport inside a real window, and its real tab strip and toolbar sit on top. Every one of the six values comes from that window, so `outerHeight - innerHeight` is the height of an interface the engine actually drew. No two sources have to be kept in step.

We got the position wrong first. Windows opened at `0,0`, and on macOS that is under the menu bar, so every launch put the tab strip behind it. Someone reported it from inside the app as the browser going "over the whole macOS bar". A page saw it differently: `screenY` of 0 on a profile that claims 25 pixels of menu bar. The fix takes the larger of two numbers, where this Mac's usable area begins (so you can see the window) and the profile's own `availTop` (so the claim holds).

`devicePixelRatio` is left out of that change on purpose. A different switch already carries it, and changing the accessor as well would give one value two sources, which is how [two spoofs end up disagreeing](https://mosaicbrowser.com/blog/cpp-not-javascript).

## On a phone, the window is the phone

Android profiles showed what happens when the window and the claim come apart. The first live Android profile reported `innerWidth` by `innerHeight` of 500 by 607 on a much narrower phone screen: a viewport wider than the screen it is shown on, which no device produces and one subtraction finds. The cause was the desktop window winning. Now a phone profile's window is the phone's own screen size, and the viewport is fitted to it. Measured on a phone record after the fix, the screen and the viewport read the same width and height. The other things that must agree on a phone are in [a phone is a whole device](https://mosaicbrowser.com/blog/phone-viewport).

## The limit we cannot move

The chrome height is the engine's own interface as drawn on this computer. On a profile that claims the computer's own OS, that is exactly right. On a profile claiming another desktop OS, it is still this computer's toolbar. It is one more reason the strongest match is always the OS your own computer runs, alongside the fonts, which also come from the real machine.

## How to read your own

Open DevTools on any page and run:

```
[innerWidth, innerHeight, outerWidth, outerHeight, screenX, screenY,
 outerHeight - innerHeight, innerWidth - document.documentElement.clientWidth]

```

Number seven is your chrome height, number eight your scroll bar (0 if your Mac hides scroll bars until you scroll). Now toggle the bookmarks bar with Cmd+Shift+B (Ctrl+Shift+B on Windows) and run it again. `outerHeight` doesn't move; `innerHeight` drops by the bar, and number seven rises by the same amount. Docking DevTools to the right does the same thing sideways. A real window moves like that, all at once, and checking that a profile's values move together is what [fingerprint consistency](https://mosaicbrowser.com/glossary/fingerprint-consistency) means.

## Sources

1. [CSSOM View Module (Editor's Draft)](https://drafts.csswg.org/cssom-view/), read November 3, 2026

## Questions

### What is the difference between outerHeight and innerHeight?

innerHeight is the height of the viewport the page is drawn in, including a horizontal scroll bar if there is one. outerHeight is the height of the whole browser window, so it also counts the tab strip, the address bar and any bookmarks bar.

### Does innerHeight include the scroll bar?

Yes. The CSSOM View spec says innerWidth and innerHeight include the size of a rendered scroll bar. document.documentElement.clientHeight and clientWidth leave it out, so the gap between the two is the scroll bar's size.

### Why would a website compare outerHeight and innerHeight?

The difference is the browser's own interface, and its size depends on the browser and the operating system. A window whose numbers do not fit the screen it claims, or whose toolbar height suits no real browser, is easy to spot.

### Does Mosaic fake innerHeight and outerHeight?

No. The engine has a change that could claim all six window values, and we leave it switched off. Mosaic opens a real window of a size that fits the profile's screen, so every value is the one a real window of that size reports.

## Related

[screen.availTop is where your menu bar is](https://mosaicbrowser.com/blog/screen-availtop-menu-bar): screen.availTop is the height of OS chrome at the top of the screen: 25 on most Macs, 0 on Windows. It names a platform before navigator.platform does.

[A phone is a whole device, not a small window](https://mosaicbrowser.com/blog/phone-viewport): Chrome device mode vs real Android: it moves the viewport and touch, not the GPU, sensors or OS. Our first Android profile rendered wider than its screen.

[screen.width said 1728 and a media query said 1512](https://mosaicbrowser.com/blog/device-width-media-query): A binary search over max-device-width finds the real screen whatever screen.width claims. Fixing that route took IPHey from 90 to 100 on one profile.

[Fingerprint consistency: values that describe one machine](https://mosaicbrowser.com/glossary/fingerprint-consistency): Fingerprint consistency is whether every value a browser reports could be true of one real computer, on one network, on every visit. Scanners test exactly that.

[Why we change fingerprints in the engine, not in JavaScript](https://mosaicbrowser.com/blog/cpp-not-javascript): A JavaScript spoof is one realm deep. An iframe read the real source of 33 of our replaced functions; the same values set inside the engine agree everywhere.







[A number Chromium rounds, and a generator that did not](https://mosaicbrowser.com/blog/devicememory-rounding): navigator.deviceMemory values on desktop Chrome are 2, 4, 8, 16 or 32, not the spec's 0.25 to 8. Our validator kept the old list and refused its own draws.

## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
