Display refresh rate measurement
Counts animation frames per second to find the monitor's refresh rate.
In one line
Can count frames to find your screen's refresh rate
Counts animation frames per second to find the monitor's refresh rate.
requestAnimationFrame timing reveals 60, 90, 120, 144 or 165 Hz displays, and variable refresh. Combined with devicePixelRatio and screen size it narrows the device model (e.g. ProMotion iPads and iPhones at 120 Hz).
What it can and can't do
What the user does: Nothing. It happens when the page loads, or when animations run
It can
- Learn if your screen runs at 60, 90, 120, 144 or 165 Hz
- Spot variable refresh screens
- Combine it with screen size to narrow your device model
It cannot
- Know the exact screen model
- Ask permission first
- See your files
- Know who you are by itself
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 24 | 2013-01-10 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 23 | 2013-08-06 | None |
| Safari | Supported | 7 | 2013-10-22 | None |
| Safari on iPhone | Supported | 7 | 2013-09-18 | None |
| Chrome on Android | Supported | 25 | 2013-02-27 | None |
| Samsung Internet | Supported | 1.5 | 2013-09-25 | None |
How a site asks for it
| API | requestAnimationFrame deltas; matchMedia('(update: fast)') |
| Browser compat keys | api.Window.requestAnimationFrame |
| How access is granted | none |
| What the user sees | Not listed |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Not listed |
| How to take it back | Not listed |
| Inside an iframe | Not listed |
Typical flow
- Run rAF for 500 ms
- Compute mean frame delta
- Round to a common refresh rate
Data you get
What comes back: Hz, about 1 Hz accuracy
Shape: float
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
frame interval | float | ms | 4 to 33 | timer limited; rounded to 1 Hz bins |
Technical limits
- Background tabs run rAF at 0
- Battery saver caps to 30 or 60 Hz
- Safari 17 and Firefox clamp rAF to timer resolution
The story
What it is
A script counts animation frames per second to find out if your screen runs at 60, 120 or more Hz.
For you
You never see it. A game or animation tests how fast your screen updates, and then runs smoothly at that speed. A fast gaming screen gets smoother motion.
For makers
Games and animation apps need the refresh rate to avoid stutter and to match speed to the screen. The same number is a clue about your hardware, which helps fraud and tracking tools.
Where you see it
| Type | Example | Apps |
|---|---|---|
| games | A browser game finds that your screen is 144 Hz and runs its motion at that rate for a smoother feel. | Krunker.io, Shell Shockers |
| games | A cloud gaming page matches the stream frame rate to your display so there is no judder. | Xbox Cloud Gaming, GeForce NOW |
| video | A video player matches playback to the screen to avoid uneven motion in fast scenes. | YouTube |
| creative | A web animation tool shows a smooth preview at the exact refresh rate of your display. | Figma |
| security | A fraud tool sees that a device claims to be a phone but shows a refresh rate only found on a desktop monitor. | None named |
| ads | A tracker adds refresh rate to a device ID, as it differs by screen. | None named |
| accessibility | A page lowers animation speed when the screen is slow, to prevent motion that makes some people dizzy. | None named |
Risks
- Reveals your screen
- Adds to a device ID
What the platform says
- MDN: requestAnimationFrame. Lets a page draw smooth animation in time with your screen refresh.
Good uses and abuse
Legitimate uses
- Animation pacing
Known abuse
- Device class (120 Hz is iPhone Pro, iPad Pro, flagship Android)
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 3 | Rough identifying entropy, when known |
Related capabilities
Related
- High resolution timer precision. Can use a clock whose sharpness shows your browser and privacy mode
Sources
How well checked: Based on official documentation.